Repository navigation
agentHost: fix incorrect model attribution in Codex subagent responses - #340470
Merged
Giuseppe Cianci (Giuspepe) merged 3 commits intoNov 9, 2026
Merged
Giuseppe Cianci (Giuspepe) merged 3 commits into
Giuseppe Cianci (Giuspepe) merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the intended attribution behavior and includes focused regression coverage.
0 open findings
What changed in this PR
Fixes Codex subagent usage attribution so response metadata reflects the child model while retaining the parent’s provider.
Changes:
- Builds child model selections from the reported subagent model.
- Adds regression coverage for Copilot, OpenAI, and fallback attribution.
| File | Description |
|---|---|
src/vs/platform/agentHost/node/codex/codexAgent.ts |
Assigns the correct model to local subagent sessions. |
src/vs/platform/agentHost/test/node/codex/codexCreateChat.test.ts |
Tests subagent usage-model attribution scenarios. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Contributor
Author
|
@microsoft-github-policy-service agree |
…model-display # Conflicts: # src/vs/platform/agentHost/node/codex/codexAgent.ts
…model-display # Conflicts: # src/vs/platform/agentHost/test/node/codex/codexCreateChat.test.ts
Giuseppe Cianci (Giuspepe)
approved these changes
Nov 5, 2026
Alexandru Dima (alexdima)
approved these changes
Nov 5, 2026
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex subagent responses could display the parent model in the response
footer and token breakdown, even when the subagent used a different model.
For example, the parent session uses model A, while
config.tomlspecifies model B as the default model for subagents. The subagent
actually runs on model B, but opening its session shows model A in the
response footer and token breakdown. This is a display-only bug.
Pass the model reported by the completed
spawnAgentitem into the localsubagent session, preserving the parent's effective provider without
inheriting the parent model's configuration.
When the item does not report a model, preserve the existing fallback to
the parent model.
This changes local usage attribution only, not Codex model selection.
Testing
Added regression coverage for: