Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#172 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
2
Forks
2
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PierrunoYT/patch

Todos los issues de PierrunoYT/patch

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.