Listen to Claude Code's StopFailure hook to detect API-failed turns immediately
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
- 48/100
Línea de trabajo
Start by reading the Claude profile's hook registration in bmad-loop init, then trace how the relay journals Stop and how the engine handles transport or environment faults. The issue does not name specific files or tests, so first locate those entry points and existing recovery paths. Done means StopFailure is registered and journaled, transient errors recover without charging a dev attempt, and account or quota errors pause with an escalation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe your idea
Register Claude Code's StopFailure hook event in the relay, so a turn that ends on an API error is seen at once instead of through the stall budget.
Why is this needed?
On bmad-loop 0.13.0 (Claude Code adapter, herdr backend, Linux), a dev session finished its work, then its turn ended on an API error ("Connection lost mid-response"). The relay recorded no Stop for that session. The pane sat idle for about 34 minutes until I unblocked it by hand with a message. Policy at the time: session_timeout_min = 90, dev_stall_grace_s = 600, dev_stall_nudges = 2. From the hook events alone I cannot tell whether the stall nudges fired.
bmad-loop init registers SessionStart, Stop, SessionEnd, PreCompact and Notification. Claude Code also emits StopFailure when a turn ends because of an API error. Its input carries error (rate_limit, overloaded, server_error, unknown, authentication_failed, billing_error, ...), error_details and last_assistant_message (type StopFailureHookInput in Claude Code's hook type definitions). Today this signal is lost, and the loop can only learn about the failure from silence. I found no mention of StopFailure in the 0.13.1 release notes or in existing issues.
How should it work?
initregistersStopFailurefor theclaudeprofile, next to the existing events, and the relay journals it likeStop.- On
StopFailure, the engine classifies the turn as a transport or environment fault without charging a dev attempt, then recovers through the existing path (nudge or relaunch) instead of waiting for the grace to expire. errordrives the choice: transient values (overloaded,server_error,unknown) retry; account or quota values (rate_limit,billing_error,authentication_failed) pause the run with a clear escalation, since a retry cannot succeed.
Additional context
Related: #194 (API failure charged as a timeout), #470 (stall detection arming), #764 (late transient 5xx classified as an environment fault), #610 (usage-limit pattern).
- Lenguaje dominante
- Python
- Estrellas
- 178
- Forks
- 73
- Merge medio
- 17 h 56 min
- PR fusionados (30 d)
- 95
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bmad-code-org/bmad-loop
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
bmad-code-org/bmad-loop#973 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bmad-code-org/bmad-loop#965 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
bmad-code-org/bmad-loop#1004 ·
Los mantenedores suelen responder en 1 día
-
tickets: an injected plan_halt result for a built plan escalates with stopped-attempt wordingAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 36/100
bmad-code-org/bmad-loop#972 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 49/100
bmad-code-org/bmad-loop#971 ·
Los mantenedores suelen responder en 1 día
Todos los issues de bmad-code-org/bmad-loop
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
[Bug] vllm-sr config migrate drops providers.models[].deploymentPosiblemente ocupada @Bevisy la tomó hoy. Abiertoneeds-acceptance wg/developer-experience-ecosystem
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
vllm-project/semantic-router#5996 ·
Los mantenedores suelen responder en 2 días
-
bugfix low-priority plugin:abstract plugin:leyline small-effort source:discussion
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
athola/claude-night-market#1132 ·
-
Add support for Sinhala languageAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
WeblateOrg/language-data#2773 ·
Los mantenedores suelen responder en 1 día
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Abiertokind/bug priority/medium qa_automation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yugabyte/yugabyte-db#37324 ·
Los mantenedores suelen responder en 1 día