Skip to content

feat(opencode): add opt-in assistant auto-continue#18157

Draft
anduimagui wants to merge 1 commit intoanomalyco:devfrom
anduimagui:feat/assistant-auto-continue
Draft

feat(opencode): add opt-in assistant auto-continue#18157
anduimagui wants to merge 1 commit intoanomalyco:devfrom
anduimagui:feat/assistant-auto-continue

Conversation

@anduimagui
Copy link
Contributor

Issue for this PR

Closes #18156

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This adds an opt-in experimental.auto_continue config 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 as Yes. 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 small run client 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 real opencode run sessions.

How did you verify your code works?

  • Ran bun run typecheck in packages/opencode
  • Ran bun test test/session/autocontinue.test.ts test/config/config.test.ts --filter "AutoContinue|experimental.auto_continue" in packages/opencode
  • Ran live bun run --conditions=browser ./src/index.ts run ... checks in packages/opencode to verify new sessions, follow-up sessions, and auto-continue behavior end to end

Screenshots / recordings

Not included (non-UI change).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Opt-in assistant auto-continue for generic continuation prompts

1 participant