Skip to content

v1.21.0 — the SessionEnd budget no host gave, and the watchdog that held the pipe - #22

Merged
sshlg merged 1 commit into
mainfrom
fix/sessionend-codex-budget
Sep 27, 2026
Merged

sshlg merged 1 commit into
mainfrom
fix/sessionend-codex-budget

Conversation

@sshlg

@sshlg sshlg commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Codex 0.157 printed clamping SessionEnd hook timeout to 3s in …/agent-sync/…/hooks.json
at every session start. The hook declared 20 s; Codex clamps a SessionEnd handler to 3 s,
and Claude Code sizes its SessionEnd wait from the largest handler timeout.

  • hooks.json declares timeout 3; check_hooks_manifest refuses more, with a self-test
    plant of the shipped 20
  • release --held gives back everything the run holds in ONE process; session-end.sh
    runs it under a 2 s limit instead of whoami plus one release process per key
  • run_limited's bash fallback (stock macOS has no timeout/gtimeout) left an orphan
    sleep holding the caller's pipe, so $(run_limited 10 …) and | sed waited the full
    limit. session-end took 10.4 s for three leases. The watchdog now polls kill -0 in
    0.1 s steps with its stdio on /dev/null

Gate: npm test EXIT=0 — validate PASS v1.21.0, SELF-TEST PASS (62 fixtures), claim cell
27, session hooks 13 (7 new), installer 11.

🤖 Generated with Claude Code

…eld the pipe

Codex 0.157 printed `clamping SessionEnd hook timeout to 3s in …/agent-sync/…/hooks.json`
at every session start. The hook declared 20 s; Codex clamps a SessionEnd handler to 3 s,
and Claude Code sizes its SessionEnd wait from the largest handler timeout.

- hooks.json declares timeout 3; check_hooks_manifest refuses more, with a self-test
  plant of the shipped 20
- `release --held` gives back everything the run holds in ONE process; session-end.sh
  runs it under a 2 s limit instead of whoami plus one release process per key
- run_limited's bash fallback (stock macOS has no timeout/gtimeout) left an orphan
  `sleep` holding the caller's pipe, so $(run_limited 10 …) and `| sed` waited the full
  limit. session-end took 10.4 s for three leases. The watchdog now polls kill -0 in
  0.1 s steps with its stdio on /dev/null

Gate: npm test EXIT=0 — validate PASS v1.21.0, SELF-TEST PASS (62 fixtures), claim cell
27, session hooks 13 (7 new), installer 11.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sshlg
sshlg merged commit f130b1e into main Sep 27, 2026
2 checks passed
@sshlg
sshlg deleted the fix/sessionend-codex-budget branch September 27, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant