mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 11:53:10 +08:00
664c6ebd9f
A desktop session can pass the startup grace window and then lose its CLI subprocess before a result arrives. Previously that path only deleted the active process record, leaving the WebSocket client in an active turn with no terminal message. The process-exit handler now emits a synthetic CLI error result through the existing translation path so the UI receives both an error and message_complete. The mock SDK fixture can reproduce post-startup exits, and the integration test locks the terminal event behavior. Constraint: The frontend already relies on result is_error translation to emit error plus message_complete. Rejected: Add a separate WebSocket process-exit message type | it would duplicate existing result-error handling and require another frontend state path. Confidence: high Scope-risk: narrow Directive: Keep process-exit failures on the same result-error path unless the client protocol gains a dedicated terminal error event. Tested: bun test src/server/__tests__/conversations.test.ts Tested: cd desktop && bun run lint Tested: agent-browser against http://127.0.0.1:1421 with mock CLI late exit; page showed CLI process exited unexpectedly and composer became editable again