OTel: parent chat spans keep the last subagent model in gen_ai.request.model
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- shell
- Bereich
- cli, observability
Rechercherichtung
Start by tracing the Copilot CLI's OTel export path and how session.model_change events with source=agent update model state for parent chat spans. Compare where gen_ai.request.model and gen_ai.response.model are populated across parent and subagent calls. Done means later parent spans retain the parent model while genuine dated model snapshots remain valid, with regression coverage for the described sequence.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
After a subagent model switch, later parent chat spans keep the subagent's model in gen_ai.request.model . gen_ai.response.model and the billed AIU stamp still match the model that actually served the call.
Observed on Copilot CLI 1.0.88. A session was switched to claude-opus-5.5 with the model picker, then dispatched subagents ( session.model_change with source=agent to gpt-5.6-sol , gpt-6-sol , grok-4.7 , and others). Parent calls continued on Opus. Of 226 parent chat spans whose gen_ai.response.model was claude-opus-5.5 , only 10 also had gen_ai.request.model=claude-opus-5.5 . The other 216 were labeled with whichever subagent model had been selected most recently.
The AIU on those spans is correct. One mislabeled span had gen_ai.request.model=gpt-5.6-sol , gen_ai.response.model=claude-opus-5.5 , input 85409, cache read 83052, cache write 2353, output 593, and copilot_chat.copilot_usage_nano_aiu=4025140000 . That is $0.0402514, which matches the Opus 5.5 rate card exactly, not Sol's. Over that session the mislabeled Opus spans were about $20.43 of a $21.24 Opus total. Across 24 hours this was 521 CLI spans and about $41.37, all service.name=github-copilot . VS Code copilot-chat did not show this shape.
Consumers that attribute cost by gen_ai.request.model therefore file Opus spend under the leftover subagent model. The total is not lost. The slice is.
Affected version
GitHub Copilot CLI 1.0.88
Steps to reproduce the behavior
- Run Copilot CLI 1.0.88 with OTel export enabled.
- Start a session and select a parent model with the model picker, for example claude-opus-5.5 .
- Dispatch one or more subagents that run a different model, so the session log records session.model_change with source=agent .
- Let the parent keep making model calls after those switches.
- Compare gen_ai.request.model and gen_ai.response.model on the later parent chat spans.
The request label is the last subagent model. The response label, token usage, and copilot_chat.copilot_usage_nano_aiu still describe the parent model.
Expected behavior
On a parent chat span, gen_ai.request.model should be the model that parent call asked for, matching gen_ai.response.model except for a genuine dated snapshot of that same model. A nested subagent's model switch should not leak onto later parent spans.
Ignoring gen_ai.request.model is not a valid workaround. For some models the response label is a dated snapshot of the request, not a different model: gpt-5.4 is served as gpt-5.4-2026-03-05 , and claude-haiku-4.5 as claude-haiku-4-5-20251001 . Those are aliases. This bug is a different model left in the request label.
Additional context
• Windows, PowerShell, CLI 1.0.88. Spans are service.name=github-copilot .
• The leak tracks session.model_change events with source=agent . The picker change ( source=model_picker ) sets the parent correctly. Later agent-sourced changes overwrite the request label used on subsequent parent spans.
• Billing attributes are present and consistent with the response model. This is not github/copilot-cli#4224. It is also not github/copilot-cli#4862 (those spans are missing response identity and usage) or github/copilot-cli#4825 (HydraFusion, where gen_ai.request.model=hydrafusion is intentional).
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 17 Std. 6 Min.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/copilot-cli
-
triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
github/copilot-cli#4963 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
github/copilot-cli#4932 ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/copilot-cli#4909 ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
github/copilot-cli#4906 ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
github/copilot-cli#4848 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in github/copilot-cli
Ähnliche Issues
-
Update cliamp to 2.3.0Offenpackage-update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
oSoWoSo/vOid_Community_repOsitory#203 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] v-quick-install-app install crashes with ValueError if no supported PHP version is installedOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
chore
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
alunduil/alunduil-chezmoi#809 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
catppuccin/kde#152 ·