[codex] Fix watchdog death detection and resume target - #4
Draft
palios-taey wants to merge 1 commit into
Draft
palios-taey wants to merge 1 commit into
palios-taey wants to merge 1 commit into
Conversation
Closes task-4fb37e4e
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
Fixes
task-4fb37e4efor the watchdog restart path. The change separates probe failure/timeout from definitive Claude process absence, adds restart fail-safes, and resumes using the pane-specific ClaudesessionIdinstead of the globallatestconversation.Root Cause
_claude_running()returned only a boolean, so a probe timeout or tmux/pstree failure was treated the same as a confirmed missing Claude process. Under load, that could restart an alive-but-stalled session._restart()also accepted commands likeclaude --resume latest, which can resume the newest global conversation rather than the tmux pane's own session.Changes
True/False/Nonefrom Claude liveness probing, whereNonemeans unknown and never restarts.CCW_DEAD_CONFIRM_POLLS, default2).cpu_count * CCW_RESTART_LOAD_MULTIPLIER(default4).~/.claude/projects/<sanitized-cwd>/, read the newest.jsonl, and substitute itssessionIdinto{session_id}.latestor omit{session_id}.Validation
python3 -m unittest discover -s tests -v-> 36 tests passed.python3 -m py_compile watchdog.py tests/test_watchdog.py-> passed.git diff --check-> passed.python3 watchdog.py --help-> verified help documents{session_id}and refuseslatest.PASS live true-dead session restarts with pane-specific session idPASS live extreme-load guard suppresses restartPASS live probe-unknown path suppresses restart_claude_running,_restart,check, andWatchdog;_claude_running,_restart, andcheckreported HIGH blast radius.npx gitnexus detect-changes --scope staged -r claude-code-api-watchdogreturnedNo changes detecteddespite the staged diff, so this PR records that as a GitNexus detection blind spot rather than evidence of no code changes.Deployment Note
I did not reinstall
/usr/local/bin/watchdog.py, change the watchdog launcher, or re-enable--resume-cmdin production. This is intentionally left for r5 gate + Jesse validation + deploy control.