summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
index 2a0ac8461..ab9487e1d 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
@@ -202,7 +202,11 @@ export function Prompt(props: PromptProps) {
syncedSessionID = sessionID
- if (msg.agent) local.agent.set(msg.agent)
+ // Only set agent if it's a primary agent (not a subagent)
+ const isPrimaryAgent = local.agent.list().some((x) => x.name === msg.agent)
+ if (msg.agent && isPrimaryAgent) {
+ local.agent.set(msg.agent)
+ }
if (msg.model) local.model.set(msg.model)
if (msg.variant) local.model.variant.set(msg.variant)
}