Skip to content

Conversation

@sethcarlton
Copy link
Contributor

@sethcarlton sethcarlton commented Jan 16, 2026

Summary

Prevents subagent model from overriding primary agent model in TUI.

Fixes #8946
Fixes #7430

Reasoning

The existing isPrimaryAgent guard already prevents subagent names from overriding the primary agent selection. Model and variant appear to have been unintentionally left outside this guard, causing the leak. This fix moves them inside the same guard for consistency.

There is an existing PR #7428 that proposes a config option to opt-in to isolation. This would work but I think this is a bug and not a feature?

Verification

Tested according to repro steps in #8946: configured subagent with different model, invoked it, interrupted during work, navigated back to primary agent, the primary agent model was retained.

Note: the web app (packages/app/src/pages/session.tsx) may have the same bug but is not addressed here.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Related PRs Found

PR #7428 - feat: add config setting to avoid subagents models overriding session model

PR #7156 - feat: add variant support for subagents

@rekram1-node
Copy link
Collaborator

thx!

@rekram1-node rekram1-node merged commit 08b94a6 into anomalyco:dev Jan 16, 2026
6 checks passed
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.

Primary agent model switches to subagent model after returning to session Models in subagents override TUI session model

2 participants