Troubleshooting Subagent Model Routing Failures in AI Coding Tools
This guide explains why a subagent in a desktop AI coding tool keeps using the parent session's model despite a saved configuration. It covers the core root cause—treating an authorization allowlist as a default value—the full mechanism chain from config writing to runtime routing, a three-layer evidence collection process, fixes, nested preset pitfalls, verification steps, and a quick troubleshooting checklist.
1. Symptoms: The Configuration Looks Correct, but the Behavior Is Wrong
In the plugin settings of a desktop AI coding tool, a user assigns a model to a subagent. Saving goes smoothly all the way: no validation errors, no unsaved-changes prompt. After restarting the host process, creating a new session, and reviewing the configuration entries repeatedly, the values are still there. Yet once the main agent delegates a subtask, the subagent still reports the model used by the parent session. Another common response is “I can’t confirm my own model.”
Both responses are misleading. The first looks like the configuration failed to load entirely; the second looks like it was only half read. Worse, the person troubleshooting tends to focus on “did it save successfully,” while the real problem hides in a mismatch between configuration semantics and configuration hierarchy.
The impact goes beyond “the wrong model was selected.” In cost-sensitive scenarios, the subagent is billed against and consumes the quota of the parent session’s higher-tier model. In latency-sensitive scenarios, batch tasks that should have been offloaded to a lightweight model slow down the whole pipeline. In permission-sensitive scenarios, an allowlist that should act as a hard constraint loses its meaning because it is mistaken for a default value.
2. The One-Sentence Conclusion
Treating the “authorization allowlist” as a “default value” is the most common root cause of this class of problem. The allowlist only participates in validation when a routing field is explicitly passed in; it answers “is this allowed,” not “which one is used by default.” What actually determines the subagent’s default routing is a separate set of option fields. When that field is omitted, the system naturally falls back to the parent session’s model, so the configuration is “written but not used.”
3. The Full Mechanism Chain: From Config Writing to Runtime Routing
To explain the problem clearly, the chain can be broken into four stages:
- Config writing layer: The settings UI serializes user input into the configuration file, and the plugin side can read the entry, so the “not saved” assumption is ruled out.
- Event logging layer: A model selection policy event appears in the session event stream, and its content looks completely correct, so the “config not read” assumption is also ruled out.
- Routing decision layer: What actually decides which model the subagent uses at runtime is the default routing option; the allowlist only performs interception validation when an explicit routing field is present.
- Self-reporting layer: A running subagent typically cannot access its own routing metadata, so its self-description is inherently unreliable.
The key mismatch happens in the third stage: the default routing field is omitted → the decision falls back to the parent session model → the allowlist stays silent throughout because “there is no explicit route to validate.” No stage in the entire chain raises an error, which is exactly why it is hard to perceive through the UI.
Schematically, the decision logic can be abstracted as:
if explicit_route is provided:if explicit_route not in allowed_models:reject()use(explicit_route)else:use(default_route_option or parent_session_model)
4. Evidence Collection: Three Layers of Evidence That Lock Together
Reliable troubleshooting does not rely on the UI but on three kinds of verifiable evidence:
- Session events: Confirm the policy event was persisted, ruling out “config not loaded.”
- Cache projection: Confirm the value shown in the UI matches the actual value in the configuration file, ruling out “stale display-layer cache.”
- Source code and in-package index: Confirm the field read order and the fallback branch, locating the real decision entry point.
The recommended evidence order is bottom-up: check events first, then the projection, then the in-package code path. The conclusion holds only when all three point to the same missing field. Any inferential conclusion should be labeled separately to avoid mixing it with verified facts.
5. Fix Essentials
The core of the fix is not “save once more,” but filling in the default routing field and distinguishing it from the allowlist:
- Explicitly set the subagent’s default model, rather than only filling in the allowlist.
- Keep the allowlist as a hard constraint, and make sure the default value falls within the allowlist; otherwise a new problem arises where “the default is valid but gets blocked.”
- After the change, you must create a new session to verify, since an old session may hold an already-resolved configuration snapshot.
- Keep a configuration snapshot before and after the change for easy rollback and comparison.
6. Patch Targets and Coverage: Watch Out for Nested Levels
The second high-frequency pitfall is configuration hierarchy mismatch. When the desktop and web clients share the same configuration namespace, subagent-related settings are often attached to a nested row inside a preset rather than the same-named row at the host layer. Writing to the host-layer row has no effect; when patching by identifier, you may hit the wrong target that shares the name but sits at a different level, and it will not raise an error.
Coverage checklist:
- Identify the target level: host layer or preset nested layer.
- Identify the scope: global, workspace, or a single session.
- After the change, check whether the projection cache refreshed, to avoid “changed but the UI still shows the old value.”
7. How to Verify It Actually Took Effect
Do not ask the subagent “what model are you”; instead, observe verifiable signals:
1. Create a new session and trigger one subagent delegation2. Check the resolved result of the model selection policy in the session events3. Compare the subagent's runtime routing identifier against the expected default4. Send one out-of-bounds allowlist request to confirm interception actually works
Step 4 is especially important: only when the allowlist can actively reject an out-of-bounds request can you prove it is still doing its job rather than being reduced to a decoration.
8. Division of Labor Between Subagents and Forked Subagents
In engineering practice there are usually two kinds of delegation: one is an independent subagent with its own context and routing; the other is forked delegation that inherits the parent session’s context. Their model routing strategies differ: the former relies on the default routing field, while the latter more easily follows the parent-level settings. Understanding this division helps avoid mistaking “inherited behavior” for “configuration failure.”
9. Quick Troubleshooting Order
- Was the config written? Check the file and the projection.
- Was it loaded? Check the session events.
- Does the default routing field exist? Check the in-package read order.
- Is there a hierarchy mismatch? Check the preset nested row.
- Is it an old session snapshot? Create a new session and retest.
- Is the allowlist still effective? Run one out-of-bounds interception test.
10. General Engineering Takeaways
The value of this class of problem goes beyond a single tool: any configuration system that separates “constraints” from “default values” should distinguish the two explicitly in naming and documentation; any system that merges multiple configuration layers should emit observable information at load time about “which layer the final effective value came from”; and any component whose runtime self-reporting is unreliable should provide an externally verifiable routing identifier. Building these three points into daily practice lets most “config written but not effective” problems be located in minutes.
