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
{{ message }}
Repository navigation
SessionEnd hook hangs when broker is unresponsive (missing timeout in sendBrokerShutdown) #245
sendBrokerShutdown() in scripts/lib/broker-lifecycle.mjs:43-57 creates a socket connection and waits for a data event after sending the shutdown message, but has no timeout:
Reproduction: use Codex companion during a session, then exit. If broker becomes unresponsive between session and shutdown, the SessionEnd hook hangs.
Impact
Non-blocking (session ends normally), but produces a confusing error message on every affected session exit. Users may think their session data was lost.
Hit this on Windows during a Claude Code + custom hooks integration. The Hook cancelled message appears intermittently after Codex review sessions when the broker becomes unresponsive between session and shutdown.
Local mitigation: registered the plugin's SessionEnd hook explicitly in ~/.claude/settings.json with timeout: 30 (the upstream plugins/codex/hooks/hooks.json declaration didn't auto-merge into our active hook list, so cleanup was never running). That gets the outer 30s budget, but the underlying issue is still that sendBrokerShutdown itself never times out — the 30s is just CC's outer kill, not graceful.
The suggested 3s socket-level timeout fix in the issue body matches what we'd expect. Happy to test it against our reproduction setup if a PR materializes.
(Adding a +1 / data-point in case it helps prioritize.)
Same class as #288 — scenario 2 in the #163 map: the SessionEnd hook hangs on an unresponsive broker because sendBrokerShutdown has no timeout. Out of scope for PR #490 (the timer lives inside the broker, the hang is client-side). The fix is a client-side bounded timeout. See #163.
Cross-reference: #612 and PR #623 make shutdown fail closed on ambiguous outcomes, but intentionally leave the accepted-and-never-replies timeout out of scope. This issue remains the tracker for bounding that exchange and destroying the socket within the SessionEnd hook budget. Duplicate report: #288.
Activity
fix(claude): bump SessionEnd hook timeout to avoid /exit cancel regre…
pandalaohe commentedon Apr 30, 2026
Hit this on Windows during a Claude Code + custom hooks integration. The
Hook cancelledmessage appears intermittently after Codex review sessions when the broker becomes unresponsive between session and shutdown.Local mitigation: registered the plugin's
SessionEndhook explicitly in~/.claude/settings.jsonwithtimeout: 30(the upstreamplugins/codex/hooks/hooks.jsondeclaration didn't auto-merge into our active hook list, so cleanup was never running). That gets the outer 30s budget, but the underlying issue is still thatsendBrokerShutdownitself never times out — the 30s is just CC's outer kill, not graceful.The suggested 3s socket-level timeout fix in the issue body matches what we'd expect. Happy to test it against our reproduction setup if a PR materializes.
(Adding a +1 / data-point in case it helps prioritize.)
axisrow commentedon Jul 16, 2026
Same class as #288 — scenario 2 in the #163 map: the
SessionEndhook hangs on an unresponsive broker becausesendBrokerShutdownhas no timeout. Out of scope for PR #490 (the timer lives inside the broker, the hang is client-side). The fix is a client-side bounded timeout. See #163.yuanchen8911 commentedon Aug 10, 2026
Cross-reference: #612 and PR #623 make shutdown fail closed on ambiguous outcomes, but intentionally leave the accepted-and-never-replies timeout out of scope. This issue remains the tracker for bounding that exchange and destroying the socket within the SessionEnd hook budget. Duplicate report: #288.
dkundel-openai commentedon Aug 11, 2026
Duplicate of #288.