Skip to content

feat(opencode): preserve model choice on plan handoff - #1414

Closed
rohanhasabe-esper wants to merge 3 commits into
backnotprop:mainfrom
rohanhasabe-esper:main
Closed

rohanhasabe-esper wants to merge 3 commits into
backnotprop:mainfrom
rohanhasabe-esper:main

Conversation

@rohanhasabe-esper

@rohanhasabe-esper rohanhasabe-esper commented Aug 28, 2026 •

Copy link
Copy Markdown

Summary

  • preserve the active OpenCode model when approving a plan
  • let reviewers choose an agent default or a specific available model before handoff
  • display the resolved current model in the Approve dropdown and widen it to avoid truncation
image

Verification

  • bun test apps/opencode-plugin packages/ui packages/editor packages/server apps/hook
  • DOM_TESTS=1 bun test packages/ui/components/HtmlSurfaceControls.test.tsx packages/ui/components/ApproveDropdown.currentModel.test.tsx
  • bunx tsc --noEmit -p packages/ui/tsconfig.json
  • bunx tsc --noEmit -p packages/server/tsconfig.json
  • bun run --cwd apps/review build && bun run build:hook && bun run build:opencode
  • Manually submitted and approved a dummy plan through OpenCode; confirmed the current model appears in the handoff dropdown.

…rent-model preview

Compute the session's active model once, up front in submit_plan's
execute(), and thread it through both plan-review runtimes
(embedded + CLI bridge) into /api/plan. The Approve dropdown now shows
the actual model id (e.g. gpt-5.6-terra) instead of the literal string
'current model' when 'Keep current model' is selected, and falls back
to the old generic text when the host can't supply it.

Also widen the dropdown panel (w-52 -> w-72) so model ids aren't
truncated at the edge, per review feedback.
@backnotprop

Copy link
Copy Markdown
Owner

Thanks for digging into this, @rohanhasabe-esper — the underlying complaint was real and it's now fixed on the V2 path: #1569 makes the OpenCode 2 adapter apply switchModel alongside switchAgent so the session's model follows the approved agent. That landed with the opposite resolution to yours (the target agent's configured model wins rather than the previously active one), so the picker and plumbing here would now pull against it. Closing for that reason — but if you still hit a wrong model on the V1 session.prompt path, that branch genuinely is unfixed and a small PR reconciled with #1569's semantics would be very welcome.

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