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

Timed-out sessions are journalled with tokens: 0, hiding the most expensive sessions from status, metrics and max_tokens_per_story

Abierto
#778 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Comienza con el manejo de los veredictos timeout, stalled y over_budget, y luego sigue cómo se lee el uso de la sesión completada después de usage_grace_s y se escribe en el journal. Comprueba el manejo del transcript del adapter para una sesión y sus hijos; done significa que los costes de timeout llegan a status, metrics, digests y max_tokens_per_story, mientras que los fallos de lectura registran null en lugar de zero.

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

Descripción

area:adapters bug needs-design P3

Summary

A session that ends by timeout is journalled with tokens: 0 and tokens_weighted: 0, so the run total, per-story cost, max_tokens_per_story and any digest built on the journal omit the most expensive sessions of the night.

Observed (0.11.1)

Setup: an unattended nightly sweep run with [limits] session_timeout_min = 180, max_dev_attempts = 2 and [scm] isolation = "worktree"; the dev adapter is Claude Code.

session-end  <story>-dev-1  status: timeout  tokens: 0  tokens_weighted: 0
session-end  <story>-dev-2  status: timeout  tokens: 0  tokens_weighted: 0

The Claude transcripts of those two 3-hour sessions and their subagents sum to 114,498,346 raw tokens, 14.7M weighted at cache_read_weight = 0.1 (deduplicated per message id; a transcript repeats a response's usage once per content block). bmad-loop status reports the run at 41,460,533 raw, all from the one story that completed: the timed-out story was about 73 percent of the night's spend and shows as zero.

Consequences: max_tokens_per_story cannot fire for the sessions most likely to exceed it; status, metrics and the digest undercount by the full cost of every timeout; and #611's zero-token heuristic would classify a fully productive 3-hour session as an environment fault.

Proposal

On a timeout / stalled / over_budget verdict, read usage from the adapter's transcript for the session and its children, as a completed session's usage is read after usage_grace_s. The transcript is on disk before the kill (straggler-reap follows timeout-fired by ~200 ms). If the read fails, journal tokens: null rather than 0, so an absent measurement is distinguishable from a free session.

Lenguaje dominante
Python
Estrellas
146
Forks
68
Merge medio
1 d 19 h
PR fusionados (30 d)
44

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 bmad-code-org/bmad-loop

Todos los issues de bmad-code-org/bmad-loop

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.