Subagent Model Configuration Not Taking Effect in AI Coding Tools: Troubleshooting and Fix
This article explains why a subagent model setting can appear saved yet never take effect in a desktop AI coding tool, and how to diagnose and fix it. It shows that an authorization allowlist is often mistaken for a default value, walks through the full subagent creation chain, and presents a four-layer evidence-gathering process based on config files, session events, projection caches, and source code. It also covers the fix, scope-related patch pitfalls, verification criteria that avoid relying on a subagent's self-report, and a quick troubleshooting checklist.
1. Symptoms and Impact
In the plugin settings of a desktop AI coding tool (referred to below as the “host tool”), a user assigns a model to a subagent. The save completes without any error, and the entry is visible both in the config file and in the plugin panel. However, after restarting the host tool, opening a new session, and asking the main agent to delegate to a subagent that reports its own model, two kinds of responses appear:
- The subagent reports the model used by the parent session.
- The subagent says it cannot confirm its own model.
Both responses are misleading. The first suggests the setting did not apply at all; the second suggests the config was never read. The actual impact includes:
- Cost expectations for delegated tasks spiral out of control, since the default route may point to a more expensive model.
- Output style and context behavior become inconsistent.
- In team collaboration, members cannot reproduce each other’s configuration results.
The problem is hard to diagnose because three factors stack up:
- The config is genuinely written to disk and visible through both the UI and the file, with no “not saved” warning.
- The session event stream already contains a model selection policy event whose content is completely correct, ruling out the “config was not read” hypothesis.
- A subagent’s self-report is inherently untrustworthy. At runtime it usually cannot access its own routing metadata, so reporting the parent model name or “cannot confirm” is normal behavior.
The conclusion is clear: a subagent’s self-report cannot be used to judge whether the configuration took effect. You must rely on the event stream, the projection cache, and source-level verification.
2. The Answer in One Sentence
The authorization allowlist was mistaken for a default value. The allowlist only participates in validation when a routing field is explicitly passed in, while the subagent’s default route is actually determined by a separate set of agent option fields. When that field is absent, the system naturally falls back to the parent session model.
3. The Full Mechanism Chain
Understanding the mechanism chain is the key to avoiding a “change it, it does nothing, change it again” loop. Creating a subagent goes through roughly four steps:
- Delegation request generation: The main agent produces a delegation intent that may or may not carry an explicit routing field.
- Policy validation: If the request carries an explicit routing field, it is intersected with the authorization allowlist. A hit is allowed through; a miss is rejected or falls back.
- Default route resolution: If the request carries no routing field, the default model is read from the agent option field. If that field is empty, the parent session model is inherited.
- Runtime injection: The resolved result is written to the session event and the projection cache for auditing and UI display.
So the allowlist and the default value are two non-intersecting code paths. Configuring only the allowlist is equivalent to “you are allowed to take another road, but nobody told you which one is the default.”
4. Evidence-Gathering Process
Gather evidence from the outside in, and avoid jumping straight into source changes:
- Layer 1: Config-on-disk check. Confirm the entry exists and is spelled correctly in both the plugin config and the user-level config file.
- Layer 2: Session event check. Search for model selection policy events and confirm their content matches expectations.
- Layer 3: Projection cache check. Inspect the projection data the UI reads to determine whether this is a display-layer lag or a resolution-layer error.
- Layer 4: Source check. Locate the default route resolution logic of the subagent plugin in the packaged output and confirm which field name it reads.
Illustrative verification script (pseudocode, conveying the idea only):
# 1) Verify the default routing field exists in the config filecfg = load_profile_config()assert "agentOptions" in cfg, "missing default routing field"# 2) Verify the policy content in the most recent session eventevents = read_session_events(session_id)policy = [e for e in events if e.type == "model_selection_policy"]assert policy and policy[-1].payload["defaultModel"] == cfg["agentOptions"]["model"]# 3) Verify the projection cache matches the configprojection = read_projection_cache(session_id)assert projection["subagentModel"] == cfg["agentOptions"]["model"]
5. The Fix
The core of the fix is one sentence: add the default routing field instead of continuing to expand the allowlist.
{"tool-subagent": {"allowedModels": ["model-a", "model-b"],"agentOptions": {"model": "model-a","effort": "medium"}}}
Notes:
- After the change you must start a new session. The resolution result of an old session has already been written to events and cache and will not be recomputed automatically.
- If both user-level and project-level configs exist, make the precedence explicit to avoid “I changed the user level but the project level overrode it.”
- Changes should be brought under configuration baseline management to prevent environment drift.
6. Patch Target and Coverage
Where a patch takes effect is constrained by “scope.” There are three common traps:
- Confusing the host layer with the preset layer. Subagent config on desktop and web is often attached to a nested row inside an agent preset. A line written at the host layer will not take effect.
- Patching by identifier may hit the wrong target. When multiple presets share the same name, writing a patch by id alone may land on the wrong entry, and it fails silently without any error.
- Cross-route clearing trap. When switching routes, some implementations clear auxiliary parameters that belong to non-current routes (such as effort), producing a “I definitely configured it, but it reverted to default” situation.
For coverage, aligning the three places “preset + user level + project level” is the minimum closed loop, and the scope should be noted in the change record.
7. How to Verify It Really Took Effect
Verification must bypass the subagent’s self-report and use three criteria:
- Event criterion: The expected default route resolution event appears in a new session.
- Cache criterion: The subagent model field in the projection cache matches the config.
- Behavior criterion: Through controlled tasks, observe whether output length, style, and latency show measurable changes.
Two fallback differences are worth noting: the context window and max output are not the same concept. The former determines “how much can be read,” the latter “how much can be written.” When the two conflict in configuration, most implementations fall back to the more conservative one, which easily creates the illusion that “there was plenty of context but output was truncated early.” When troubleshooting, check them separately; do not merge the judgment.
8. Subagents vs. Forked Subagents
- Subagent: Independent context and independent routing. Suitable for parallel retrieval, review, and batch tasks.
- Forked subagent: Inherits a snapshot of the parent context. Suitable for continuing the current reasoning chain without polluting the main context.
Selection principle: does the task need a “clean context”? If yes, use an independent subagent; if it needs continuity, use a fork. Mixing the two significantly amplifies the difficulty of configuration troubleshooting, so teams should agree on a unified usage convention.
9. Troubleshooting Order Quick Reference
- Did you verify with a new session?
- Does the default routing field exist?
- Is the config scope written on the preset’s nested row?
- Was it overridden by a higher-precedence config?
- Were auxiliary parameters cleared after switching routes?
- Do the event, cache, and behavior criteria agree?
10. Practical Recommendations
Write “the allowlist is for authorization, the default value is for routing” into team standards; put config changes under baseline management; add verification scripts to the pipeline; and create dedicated checks for silent-failure scenarios (patching by id, cross-route clearing). This turns this class of problem from “black magic” into a reproducible, auditable engineering problem.
