fix(session): set finish status on halted assistant message - #42176
vladislav-miroshnikov wants to merge 2 commits into
Conversation
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
…co#42150 anomalyco#42176 anomalyco#43881 anomalyco#43607) - O(N) text/reasoning delta accumulation instead of O(N^2) string concat (anomalyco#42150) — the lazy chunk buffer joins on read - finish reason 'error' is set when a stream fails mid-flight (anomalyco#42176) - clean-EOF empty provider streams retry like transient errors (anomalyco#43881), narrowed from the upstream patch: only an attempt that produced no text/reasoning delta and no tool call qualifies, so providers that stream content but omit usage/finish are not retried into duplicate output - SSE comment heartbeats no longer reset the chunk timeout (anomalyco#43607); the streaming TextDecoder handles multi-byte characters split across reads (regression covered)
|
Added a regression that saves the failed compaction message, appends a user message, and checks that the failed task isn't selected again. It fails when I remove the All 16 processor tests pass (82 assertions), and Prettier passes. Package typecheck reported 7 diagnostics in The new head is |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #42070
Type of change
What does this PR do?
When the session processor halts due to an error that isn't a ContextOverflow (e.g. an API error from the model), the assistant message gets
errorset butfinishstays undefined. The prompt loop checksfinishto decide whether to exit — with it undefined, the loop never terminates and the session appears stuck in compaction.The fix sets
finish = "error"in the non-ContextOverflow branch ofhalt(), matching what the ContextOverflow branch already does. This is a one-line change inprocessor.ts.How did you verify your code works?
Added
expect(handle.message.finish).toBe("error")to the existing test "do not retry unknown json errors" which exercises the exact error-halt path. 15/15 tests pass inprocessor-effect.test.ts, typecheck clean.Screenshots / recordings
N/A
Checklist