summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-12-31 22:58:06 -0600
committerAiden Cline <[email protected]>2025-12-31 22:58:06 -0600
commit4039670a24d873a27d9bbe15864e360ff0e1cb16 (patch)
tree87e0ca88473c1b64c052bc478d0951ae07111842
parentd59357c89b242c58594f15b569b91855b8244f87 (diff)
downloadopencode-4039670a24d873a27d9bbe15864e360ff0e1cb16.tar.gz
opencode-4039670a24d873a27d9bbe15864e360ff0e1cb16.zip
Reapply "fix(tui): don't show 'Agent not found' toast for subagents (#6528)"
This reverts commit 97a0fd1d54414e5563d0b47a02666d1d044c2cac.
-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)
}