Repository navigation
fix(loop): CB_AUTO_RESET and CB_COOLDOWN_MINUTES in .ralphrc are ignored - #392
Closed
meodiemvuong1609 wants to merge 1 commit into
Closed
meodiemvuong1609 wants to merge 1 commit into
meodiemvuong1609 wants to merge 1 commit into
Conversation
Snapshot _env_ của hai khoá này nằm sau khối source lib, mà lib/circuit_breaker.sh gán mặc định (false, 30) lúc source. Snapshot vì thế ghi nhận mặc định như giá trị env và đè lên .ralphrc: CB_AUTO_RESET=true không bao giờ có tác dụng, circuit breaker OPEN phải chờ cooldown thay vì tự reset khi khởi động. Chuyển hai dòng vào khối snapshot trước source (frankbria#369) và thêm chúng vào bảng test dùng ralph_loop.sh thật. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (EN)
CB_AUTO_RESET=trueandCB_COOLDOWN_MINUTESset in.ralphrcnever take effect. Their_env_*snapshots are taken after the lib source block, andlib/circuit_breaker.shassigns defaults (false,30) at source time. The snapshot therefore records the lib default as if it were an environment value, andload_ralphrcrestores it over the.ralphrcvalue. Same class of bug as #369; these two keys were missed when the otherCB_*thresholds were moved.Observed in practice: with
CB_AUTO_RESET=truein.ralphrc, an OPEN breaker was never auto-reset on startup. Every restart halted immediately withstagnation_detecteduntil the 30-minute cooldown elapsed.Thay đổi (VI)
ralph_loop.sh: chuyển_env_CB_COOLDOWN_MINUTESvà_env_CB_AUTO_RESETvào khối snapshot trước khi source lib (khối [P2.2] Environment does not override .ralphrc for CB_* thresholds, MAX_CONSECUTIVE_*, CLAUDE_MIN_VERSION #369).tests/unit/test_ralphrc_security.bats: thêm hai khoá vào bảngENV_PRECEDENCE_KEYS. Các test này chạyralph_loop.shthật nên bắt được snapshot đặt sai chỗ. Trước khi sửa, test "with no environment value, .ralphrc overrides the default" đỏ với.ralphrc ignored for: CB_COOLDOWN_MINUTES CB_AUTO_RESET.Kiểm tra
bats tests/unit/: 1079 test, 1 đỏ có sẵn trên macOS, không liên quan.issue #346 repro: RALPH_SHELL_INIT_FILE…gọitimeoutvớiPATH=/usr/bin:/bin, mà macOS không có lệnh đó ở đó. Test này cũng đỏ trênmain.bats tests/integration/: 289/289 xanh.ralphkhởi động với breaker OPEN vàCB_AUTO_RESET=truetrong.ralphrcđã reset về CLOSED rồi chạy tiếp.🤖 Generated with Claude Code