{"record":{"id":"be230d659ba881fd","repo":"bytedance/deer-flow","slug":"http-response-status","errorCode":null,"errorMessage":"HTTP ${response.status}","messagePattern":"HTTP \\$\\{response\\.status\\}","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/components/workspace/input-box.tsx","lineNumber":893,"sourceCode":"    },\n    [disabled, onContextChange, context, polishingInput],\n  );\n\n  const handleGoalCommand = useCallback(\n    async (command: GoalCommand): Promise<boolean> => {\n      const request = beginGoalRequest(goalRequestStateRef.current, threadId);\n      const signal = request.controller.signal;\n      try {\n        let goal: GoalState | null = null;\n        if (command.kind === \"status\") {\n          const response = await fetch(\n            `${getBackendBaseURL()}/api/threads/${encodeURIComponent(\n              threadId,\n            )}/goal`,\n            { method: \"GET\", signal },\n          );\n          if (!response.ok) {\n            throw new Error(await readGoalResponseError(response));\n          }\n          goal =\n            ((await response.json()) as { goal?: GoalState | null }).goal ??\n            null;\n          if (\n            !isCurrentGoalRequest(\n              goalRequestStateRef.current,\n              request,\n              threadId,\n            )\n          ) {\n            return false;\n          }\n          const objective = goal?.objective;\n          toast.info(\n            objective !== undefined\n              ? // Function replacer so a goal containing `$&`/`$1` isn't\n                // interpreted as a replacement pattern.","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/frontend/src/components/workspace/input-box.tsx#L875-L911","documentation":"Thrown when the composer's `/goal` status command does a GET /api/threads/{threadId}/goal and the response is not ok. readGoalResponseError first tries to parse the Gateway's JSON `detail` field; only when the body is not JSON or lacks a string detail does it fall back to the generic `HTTP {status}`. So this message means the request failed AND the server gave no structured error detail.","triggerScenarios":"Typing `/goal` in the composer for a thread whose id no longer exists on the Gateway (404), an expired/missing auth cookie (401), a CSRF or proxy failure (403), or nginx returning a non-JSON 502/504 while the Gateway is restarting. Also occurs if the thread id in the URL was hand-edited to a malformed value.","commonSituations":"Gateway restarted or still booting when the user runs /goal; stale browser tab pointing at a deleted thread; auth token expired mid-session; Docker stack partially up (nginx running, Gateway not).","solutions":["Check the Gateway is healthy: open /health on port 8001 (or via nginx) and restart with `make stop && make dev` if needed.","Reload the page / re-login if the auth cookie expired — 401 responses then carry a JSON detail and will show a clearer message.","Verify the thread still exists in the sidebar; open it fresh so the URL carries the real thread id.","If behind a custom proxy, confirm it forwards cookies and does not rewrite the /api/threads/... path."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isGoalHttpError(e: unknown): e is Error {\n  return e instanceof Error && /^HTTP \\d{3}$/.test(e.message);\n}","tryCatchPattern":"try {\n  const r = await fetch(url, { signal });\n  if (!r.ok) throw new Error(await readGoalResponseError(r));\n} catch (e) {\n  if (e instanceof DOMException && e.name === 'AbortError') return; // thread switch, ignore\n  toast.error(e instanceof Error ? e.message : 'goal status failed');\n}","preventionTips":["Gate /goal commands behind a Gateway health check when the tab regains focus.","Always pass the AbortController signal so thread switches cancel cleanly instead of surfacing stale errors.","Keep the JSON `detail` contract on the backend so users see specific messages, not bare `HTTP {status}`."],"tags":["network","http","goal","composer"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}