fix(session): settle busy status after stream close#14
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughPrompt response streams now settle session run state after completion unless ChangesSession settlement
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant SessionHttpApi.prompt
participant ResponseStream
participant SessionRunState
participant SessionStatus
Client->>SessionHttpApi.prompt: Submit prompt
SessionHttpApi.prompt->>ResponseStream: Stream generated message
ResponseStream-->>SessionHttpApi.prompt: Complete stream
SessionHttpApi.prompt->>SessionRunState: settle(sessionID)
SessionRunState->>SessionStatus: Set status to idle or remove runner state
SessionHttpApi.prompt-->>Client: Return HTTP response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Ported from upstream anomalyco#36002.
a0b24bc to
f9a203d
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Port of upstream anomalyco/opencode#36002.
Adds a
settle()transition toSessionRunStateand calls it when the prompt SSE stream closes, so sessions no longer report busy forever when a stream terminates without a final status event.Verified:
bun test test/server/httpapi-sdk.test.ts(19 pass),bun test test/session/prompt.test.ts(55 pass; the 1 failure — 'failed subtask preserves metadata on error tool state' — is pre-existing on dev, confirmed by running the same test without this change),bun typecheckclean. Applied cleanly.Summary by CodeRabbit
Bug Fixes
Tests