Subagent token usage is priced at the chat model's rate
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- ai-infra-agents
Direzione di ricerca
Start by reading chat_manager.ts around recordUsage, session.ts lines 144–165, and the cost calculations in app.ts line 453 and chat_store.ts line 179. Trace how subagent models and usage reach those entry points, then extend task.test.ts to verify usage is associated with the model that produced it. Done when costs are calculated using each model's rates rather than the chat model's rates.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Found in the 2026-10-07 code review (traced through the code; not run).
Problem
finder always runs on SMALL_MODELS[provider], and task/oracle may run on other models. Their usage is added to the chat's single UsageTotals (chat_manager.ts recordUsage, session.ts:144-165). Then estimateCost(chat.model, usage) (app.ts:453, chat_store.ts:179) prices everything at the chat model's rates.
Impact
On an Opus 5.5 chat, Haiku finder tokens are billed at Opus prices (4× too high). On GPT-6 Astra a Luna finder is about 100× too high, including the long-context rate. The status bar and history list overstate spending.
Fix
Keep usage per model (for example UsageTotals.byModel: Record<string, UsageTotals>) and sum estimateCost over the models, or convert subagent usage to dollars when it is recorded. Pass the subagent's conversation.model to recordUsage. Extend task.test.ts to check the model the usage belongs to.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PierrunoYT/patch
-
tests
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PierrunoYT/patch#393 · 1 commento ·
-
ci: macOS hardened-runtime smoke step fails because the re-signed app's helpers cannot connect (#28)Apertabug platform: macos tests
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
PierrunoYT/patch#392 · 1 commento ·
-
blocked platform: windows
Difficoltà 4/5 1-2 giorni Idoneità per principianti 52/100
PierrunoYT/patch#329 · 3 commenti ·
-
performance priority: low severity: low
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
PierrunoYT/patch#324 ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 36/100
PierrunoYT/patch#272 · 1 commento ·
Tutte le issue di PierrunoYT/patch
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gnosis/gnosis_vpn#661 ·
I maintainer di solito rispondono entro 1 giorno
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Apertatriage:bug-verified
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Eyevinn/open-videocore#1300 ·
I maintainer di solito rispondono entro 1 giorno
-
nextjs-tracking
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
cloudflare/vinext#4390 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kubernetes-sigs/headlamp#8175 ·
I maintainer di solito rispondono entro 2 giorni