Skip to content

fix: preserve active agent across reasoning changes - #16

Merged
ian-pascoe merged 2 commits into
ian-pascoe:mainfrom
mauriciozaffari:fix/preserve-active-agent
Jul 24, 2026
Merged

fix: preserve active agent across reasoning changes#16
ian-pascoe merged 2 commits into
ian-pascoe:mainfrom
mauriciozaffari:fix/preserve-active-agent

Conversation

@mauriciozaffari

@mauriciozaffari mauriciozaffari commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • include the calling agent in synthetic variant-change prompts
  • retain that agent alongside temporary reset state for the idle reset
  • add regression coverage for both the set and reset paths

Problem

sendVariantPrompt omitted body.agent. OpenCode therefore assigned synthetic prompts to the configured default agent, which silently switched sessions using a non-default agent after set_reasoning_effort ran.

Verification

  • pnpm run format:check
  • pnpm run lint
  • pnpm run typecheck
  • pnpm run test (16 tests)
  • pnpm run build
  • reproduced against OpenCode 1.18.4 with a custom primary agent and confirmed both the variant-change prompt and subsequent assistant response retained that agent

@mauriciozaffari

Copy link
Copy Markdown
Contributor Author

Hi @ian-pascoe, thanks for this plugin, I think it's really helpful.

Would you be able to review this please?

@ian-pascoe

Copy link
Copy Markdown
Owner

@mauriciozaffari can you please add a detailed changeset? (run pnpm changeset) make it a patch. Thank you for the contribution!

@ian-pascoe
ian-pascoe merged commit f4c5e6a into ian-pascoe:main Jul 24, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 24, 2026
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.

2 participants