Skip to content

[codex] TASK(WORKSPACE-A157014E8DCFDAFA)-4: fix(chat): return 503 with actionable message when no CLI worker is connected and surface it in Web UI#250

Draft
zhangweijian97 wants to merge 1 commit into
mainfrom
workspace-a157014e8dcfdafa/4
Draft

[codex] TASK(WORKSPACE-A157014E8DCFDAFA)-4: fix(chat): return 503 with actionable message when no CLI worker is connected and surface it in Web UI#250
zhangweijian97 wants to merge 1 commit into
mainfrom
workspace-a157014e8dcfdafa/4

Conversation

@zhangweijian97

Copy link
Copy Markdown
Collaborator

Linear issue: TASK(WORKSPACE-A157014E8DCFDAFA)-4

This PR was created by the devos.ing ADHD (Agentic Development Hub & Daemon) workflow.

Includes:

  • plan + implement session output
  • separate review/testing session

…h actionable message when no CLI worker is connected and surface it in Web UI
@zhangweijian97

Copy link
Copy Markdown
Collaborator Author

Scoped review for TASK(WORKSPACE-A157014E8DCFDAFA)-4 on PR #250 is failing due to one concrete regression.

Required fix

  1. chat-routes.ts missing notFound import causes runtime ReferenceError
  • Repro: hit a missing-session route such as DELETE /api/chat/sessions/<missing-id> or GET /api/chat/sessions/<missing-id>/messages.
  • Observed: code reaches notFound("Chat session not found"), but notFound is not imported in packages/server/src/http/chat-routes.ts, so runtime throws instead of returning 404.
  • Expected: missing-session routes return structured 404 JSON responses.
  • Fix expectation: re-add notFound to the ./http-utils import list (or consistently replace those calls with another valid 404 helper).
  • Verify: run targeted tests (for example bun test packages/server/tests/chat-routes.test.ts) and confirm missing-session branches return 404 without runtime exceptions.

Validation context

Coverage for the new success-goal behavior is otherwise present (503 response test and Web API error-detail surfacing test). Full bun test is not green in this environment due to existing unrelated suite/module-resolution failures.

@zhangweijian97

Copy link
Copy Markdown
Collaborator Author

devos.ing implementation feedback for TASK(WORKSPACE-A157014E8DCFDAFA)-4

Review/testing summary:
Scoped review against TASK(WORKSPACE-A157014E8DCFDAFA)-4 found one concrete regression in the changed server route code: chat-routes.ts removed the notFound import but still calls notFound(...), which will throw at runtime on missing-session paths instead of returning a 404 response. Coverage for the new success-goal behavior is otherwise present (503 server response test and Web API error-detail surfacing test), but bun test failed in this environment (many existing unrelated suite failures/module-resolution issues), so full workspace validation is not green.

Fix instructions for the implementation agent:
Address every item below, use each body as the repair checklist, and rerun the listed verification checks.

Bugs to fix:

  1. chat-routes missing notFound import causes runtime ReferenceError
    Failing command/repro: On PR branch, call a chat-session path that should return not-found (for example DELETE /api/chat/sessions/<missing-id> or GET /api/chat/sessions/<missing-id>/messages) through the server app.
    Observed: Route execution reaches notFound("Chat session not found"), but notFound is not imported in packages/server/src/http/chat-routes.ts, causing a ReferenceError instead of a 404 response.
    Expected: Missing-session chat endpoints should return a structured 404 error response, not throw.
    Likely files/code path: packages/server/src/http/chat-routes.ts (import block and handleSessionRoute/handleMessagesRoute return branches).
    Fix expectation: Re-add notFound to the ./http-utils import list (or replace calls with another valid 404 helper consistently) so all missing-session branches return proper HTTP 404 bodies.
    Verification: Run targeted route tests that hit missing-session branches (for example bun test packages/server/tests/chat-routes.test.ts) and confirm those cases return 404 JSON responses without runtime exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant