You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[04:30:01] [bookworm] SNAPSHOT: saved to /path/to/dispatch-bridge/bookworm/pre-restart-20260426-043001.md
[04:30:01] [bookworm] RESTART: invoking launch-agent.sh bookworm --kill --initial-handoff /path/to/dispatch-bridge/bookworm/pre-restart-20260426-043001.md
Handoff file verified: /path/to/dispatch-bridge/bookworm/pre-restart-20260426-043001.md
Killed tmux session: bookworm
Launching 'bookworm' via hcom with MCP config from /path/to/agents/bookworm/.mcp.json...
Working directory: /path/to/agents/bookworm
Error: Failed to setup Claude hooks. Run: hcom hooks add claude
Note: log shows the same Error: Failed to setup Claude hooks mode also occurred on 2026-04-23 (under v0.7.11 — the original reason for our v0.7.13 upgrade) and 2026-04-25 04:30 + 05:00 + 05:30 BST (immediately post-upgrade, all three agents). Pattern is reliably reproducible from our cron pipeline; we have not yet narrowed which step is the trigger.
Repro (the SHORTCUT that PASSES, do NOT use as canary):
env -i HOME=/Users/jane USER=jane LOGNAME=jane SHELL=/bin/sh PATH=/usr/bin:/bin:/opt/homebrew/bin /opt/homebrew/bin/hcom 1 claude --tag X --headless --pty
This was canary 7b in our v0.7.11→v0.7.13 upgrade plan (post-upgrade-hcom-0713-20260425.md, line 43-48). It PASSED. We treated it as evidence the cron-context path was fixed by v0.7.13 PRs Fix headless PTY background launches on macOS #26-28. It was not.
Why the shortcut doesn't reproduce: the real pipeline goes through launch-agent.sh which does additional setup (kills tmux session, recreates, sets TMUX_BIN, runs hcom kill, then spawns). Direct env-i + direct hcom invocation skips all of that. Some interaction between launch-agent.sh and v0.7.13 inside the cron environment is the actual failure vector. We have not isolated which step. Two variables are in play (cron context vs shell context, AND launch-agent.sh wrapper vs bare hcom); we cannot attribute either alone as causal from current evidence.
Possible interaction with Issue #2: if v0.7.13's tightened state-check (Issue #2's mechanism) requires settings.json content to match an expected hash, and launch-agent.sh performs settings.json operations during spawn that diverge from what v0.7.13 expects, that could be the underlying cause. Speculative — flagging for the maintainer's awareness, not strong-claiming.
Expected: spawn completes, settings.json hooks installed, agent comes up with hooks, pty bindings.
Actual (cron-context): spawn appears to start but hook installation fails. Agent registers without hooks binding. Settings.json may be partially written.
v0.7.13: still failing in real pipeline despite passing the env-i shortcut canary
Workaround in place: scheduled-restart crons are EMERGENCY-DISABLED (# 30 4 * * * ... and # 0 5/30 5 * * * ... in crontab). Manual relaunch via bash launch-agent.sh <agent> --kill works fine — the failure is cron-context-specific.
Logs/evidence pointers (local files, not for upload):
/Volumes/Jane-Data/claudeclaw/logs/scheduled-restart.log — Sunday 04:30 BST entry showing the actual failure mode for Bookworm
/Volumes/Jane-Data/claudeclaw/dispatch-bridge/guardian/post-upgrade-hcom-0713-20260425.md — the canary plan that called this path "fixed"; lines 43-48 are the shortcut that misled us
Ask of hcom team:
Is there a known difference in v0.7.13 between cron-context spawn and shell-context spawn re: hook installation?
Suggested debugging: minimal repro outside our infra would require reproducing the launch-agent.sh wrapper (or just confirming whether hcom 1 claude --headless --pty --kill --initial-handoff from cron differs from the env-i path).
Severity: High (blocks scheduled-restart cron pipeline, which is our primary agent-self-healing mechanism).
Title: spawn silently fails when invoked through
launch-agent.shwrapper from cron context (env-i shortcut path passes)Repro (the failure path):
30 4 * * * /path/to/scripts/scheduled-restart.sh bookwormscheduled-restart.shcallslaunch-agent.sh bookworm --kill --initial-handofflaunch-agent.shissueshcom 1 claude --headless --ptyto spawn the agentError: Failed to setup Claude hooks. Run: hcom hooks add claude. Agent comes up missinghooksbinding.Reproducer log excerpt (sanitized, from our
scheduled-restart.log— Sunday 2026-04-26 04:30:01 BST, Bookworm restart fire):Note: log shows the same
Error: Failed to setup Claude hooksmode also occurred on 2026-04-23 (under v0.7.11 — the original reason for our v0.7.13 upgrade) and 2026-04-25 04:30 + 05:00 + 05:30 BST (immediately post-upgrade, all three agents). Pattern is reliably reproducible from our cron pipeline; we have not yet narrowed which step is the trigger.Repro (the SHORTCUT that PASSES, do NOT use as canary):
env -i HOME=/Users/jane USER=jane LOGNAME=jane SHELL=/bin/sh PATH=/usr/bin:/bin:/opt/homebrew/bin /opt/homebrew/bin/hcom 1 claude --tag X --headless --ptyWhy the shortcut doesn't reproduce: the real pipeline goes through
launch-agent.shwhich does additional setup (kills tmux session, recreates, setsTMUX_BIN, runshcom kill, then spawns). Direct env-i + direct hcom invocation skips all of that. Some interaction betweenlaunch-agent.shand v0.7.13 inside the cron environment is the actual failure vector. We have not isolated which step. Two variables are in play (cron context vs shell context, AND launch-agent.sh wrapper vs bare hcom); we cannot attribute either alone as causal from current evidence.Possible interaction with Issue #2: if v0.7.13's tightened state-check (Issue #2's mechanism) requires settings.json content to match an expected hash, and
launch-agent.shperforms settings.json operations during spawn that diverge from what v0.7.13 expects, that could be the underlying cause. Speculative — flagging for the maintainer's awareness, not strong-claiming.Expected: spawn completes, settings.json hooks installed, agent comes up with
hooks, ptybindings.Actual (cron-context): spawn appears to start but hook installation fails. Agent registers without
hooksbinding. Settings.json may be partially written.Versions:
Workaround in place: scheduled-restart crons are EMERGENCY-DISABLED (
# 30 4 * * * ...and# 0 5/30 5 * * * ...in crontab). Manual relaunch viabash launch-agent.sh <agent> --killworks fine — the failure is cron-context-specific.Logs/evidence pointers (local files, not for upload):
/Volumes/Jane-Data/claudeclaw/logs/scheduled-restart.log— Sunday 04:30 BST entry showing the actual failure mode for Bookworm/Volumes/Jane-Data/claudeclaw/dispatch-bridge/guardian/post-upgrade-hcom-0713-20260425.md— the canary plan that called this path "fixed"; lines 43-48 are the shortcut that misled usAsk of hcom team:
hcom 1 claude --headless --pty --kill --initial-handofffrom cron differs from the env-i path).