Listen to Claude Code's StopFailure hook to detect API-failed turns immediately
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 178
- Fork
- 73
- Merge trung bình
- 17 giờ 56 phút
- Pull request đã merge (30 ngày)
- 95
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bmad-code-org/bmad-loop
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
bmad-code-org/bmad-loop#973 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bmad-code-org/bmad-loop#965 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
bmad-code-org/bmad-loop#1004 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tickets: an injected plan_halt result for a built plan escalates with stopped-attempt wordingĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 36/100
bmad-code-org/bmad-loop#972 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 49/100
bmad-code-org/bmad-loop#971 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bmad-code-org/bmad-loop
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] vllm-sr config migrate drops providers.models[].deploymentCó thể đã có người làm @Bevisy đã nhận hôm nay. Đang mởneeds-acceptance wg/developer-experience-ecosystem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
vllm-project/semantic-router#5996 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bugfix low-priority plugin:abstract plugin:leyline small-effort source:discussion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
athola/claude-night-market#1132 ·
-
Add support for Sinhala languageĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
WeblateOrg/language-data#2773 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Đang mởkind/bug priority/medium qa_automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
yugabyte/yugabyte-db#37324 ·
Maintainer thường phản hồi trong vòng 1 ngày