feat(opencode): add opt-in assistant auto-continue#18157
Draft
anduimagui wants to merge 1 commit intoanomalyco:devfrom
Draft
feat(opencode): add opt-in assistant auto-continue#18157anduimagui wants to merge 1 commit intoanomalyco:devfrom
anduimagui wants to merge 1 commit intoanomalyco:devfrom
Conversation
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 #18156
Type of change
What does this PR do?
This adds an opt-in
experimental.auto_continueconfig that watches finalized assistant messages for narrow continuation phrases like "If you'd like, I can continue." When a match is found on the latest assistant reply, OpenCode sends a synthetic follow-up prompt such asYes. Do this.so the session can keep moving without a redundant user turn.The implementation hooks into
message.updated, dedupes by assistant message ID, only checks the latest assistant message in the session, and keeps the prompt text plus regex list configurable. I also included a smallrunclient fix so the local CLI path correctly passes auth headers and the working directory to the SDK client, which was required to verify the end-to-end flow in realopencode runsessions.How did you verify your code works?
bun run typecheckinpackages/opencodebun test test/session/autocontinue.test.ts test/config/config.test.ts --filter "AutoContinue|experimental.auto_continue"inpackages/opencodebun run --conditions=browser ./src/index.ts run ...checks inpackages/opencodeto verify new sessions, follow-up sessions, and auto-continue behavior end to endScreenshots / recordings
Not included (non-UI change).
Checklist