Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Subagent token usage is priced at the chat model's rate

Chiusa
#172 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

bug priority: medium severity: medium

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PierrunoYT/patch

Tutte le issue di PierrunoYT/patch

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.