fix(maestro): handle 202 as no-body response in jsonOrError
The daemon returns 202 Accepted when a structured prompt is queued. jsonOrError only skipped res.json() for 204, so the empty 202 body caused a JSON parse error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1cc05af323
commit
d332c43a9f
+1
-1
@@ -39,7 +39,7 @@ export class ApiRequestError extends Error {
|
||||
|
||||
async function jsonOrError<T>(res: Response): Promise<T> {
|
||||
if (res.ok) {
|
||||
if (res.status === 204) return undefined as unknown as T;
|
||||
if (res.status === 204 || res.status === 202) return undefined as unknown as T;
|
||||
return (await res.json()) as T;
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user