fix(opencode): Fix hardcoding default build OpenCode agent when sending responses - #1131
Conversation
…r review feedback only
The agent switch cookie is shared by plan approval and code review, so
flipping the stored default to `disabled` also removed OpenCode's
plan-approval hand-off for every user who never configured the setting.
Make the unset default surface-aware instead: `getAgentSwitchSettings('plan')`
keeps the historical build hand-off, `getAgentSwitchSettings('review')`
stays on the current agent. An explicit user choice still applies to both
surfaces. Settings and the agent warning resolve the default from the mode
they render in, and the OpenCode "agent not available" warning now names
plan approval on the plan path.
Claude-Session: https://claude.ai/code/session_01H5KQWqXqjrPxyxUNso1QHS
|
Thanks for the fix. We kept your validation path and the review-feedback behavior exactly as you built it: agents are validated through client.app.agents(), an unavailable agent is omitted with a log plus toast, and the empty custom-name case no longer leaks "custom" as an agent name. One change on top: the agent switch cookie is shared by plan approval and code review, so flipping the stored default to disabled also removed the OpenCode plan-approval handoff for everyone who never touched the setting. I pushed a commit that makes the unset default surface-aware instead. Plan approval keeps defaulting to the build handoff, so existing plan-mode users see no change, and review feedback now defaults to staying on the current agent as you intended. An explicit choice in Settings still applies everywhere. |
# Conflicts: # apps/opencode-plugin/cli-bridge.test.ts # apps/opencode-plugin/cli-bridge.ts # apps/opencode-plugin/commands.ts # apps/opencode-plugin/index.ts
Summary
build#1123 by removing OpenCode's implicit fallback tobuildwhen agent switching is unset/disabled.What changed
agentparameter.client.app.agents()before request submission.Testing
Demo/Screenshots
Bug
Before
After
New warning toast if user manually enters a invalid custom agent via Settings