The route and the model are different decisions.
A model label such as deepseek-v4-flash does not identify the endpoint or credential by itself. The provider route selects those operational details. If two configured providers expose the same model label, checking only the model name cannot prove which account is being charged.
What the current code does.
The in-process driver resolves a child through resolveChildAgentOptions(parent, request.agentOptions). The resolver copies provider, model, and maxTokens from parent.options, unless an explicit child option overrides a value.
That is consistent with the documented intent—children inherit the parent route—but parent.options is a creation-time configuration snapshot. A later Web UI model selection can change the route used by the live session without updating that snapshot. The child then inherits history rather than current state.
Why this matters beyond correctness
A silent route mismatch crosses an operational boundary. It may select a differently priced account, send data to another provider, apply a different context limit, or invalidate an evaluation that assumed parent and child used the same route.
Mitigate before you delegate.
- Select the target provider and model before creating the parent session. If you changed the route inside an existing session, create a fresh session before the first subagent call.
- Verify provider, not only model. Inspect the parent and child
request/header.config.providervalues in a two-provider test. - Put budgets on every credential. Treat an unused fallback key as reachable until route inheritance is verified.
- Temporarily disable unintended routes for sensitive runs. This turns a silent billing error into a visible configuration failure.
- Re-run the regression after upgrading. Use two providers exposing the same model name; otherwise the test can miss the exact failure mode.
The durable fix.
The child should prefer the parent session’s latest effective request route, fall back to creation options only before the first parent request, and preserve explicit child overrides as the highest-precedence input. Token limits also need ownership-aware handling so an adapter default does not accidentally become an explicit cap on another route.
Primary evidence.
- Child option resolver on the verified upstream revision
- In-process driver call site
- Independent reproduction and tested patch discussion
- Original unexpected-billing report and source-backed diagnosis
Keep the field guide close
Build agents with visible boundaries.
The open handbook maps subagents, providers, tools, approval, sandboxing, MCP, sessions, and production verification back to primary DeepSeek Harness sources.
Read and star the handbook