fix(core): harden prompt loop and async session handling#21574
Open
sjawhar wants to merge 1 commit intoanomalyco:devfrom
Open
fix(core): harden prompt loop and async session handling#21574sjawhar wants to merge 1 commit intoanomalyco:devfrom
sjawhar wants to merge 1 commit intoanomalyco:devfrom
Conversation
277fd3a to
900e12f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #17982
Closes #19855
Closes #21524
Type of change
What does this PR do?
This hardens the session prompt loop and the detached
prompt_async/cancel paths.It fixes prompt-loop continuation logic, improves message-v2 handling for incomplete/error cases, makes detached
prompt_asyncexecution/reporting safer, and prevents the TUI prompt/cancel path from leaking unhandled promise rejections into stderr.How did you verify your code works?
cd packages/opencode && bun typecheckcd packages/opencode && bun test test/server/session-messages.test.ts test/session/cancel.test.ts test/session/message-v2.test.ts test/session/prompt.test.tssession/prompt.ts,session/message-v2.ts, andserver/routes/session.tsScreenshots / recordings
N/A (core/session behavior change)
Checklist