claude-code: add timeout to session-start hook#1237
Open
MuskanPaliwal wants to merge 3 commits into
Open
Conversation
Entire-Checkpoint: 01d84dee8fed
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.
refs #1065
adds Claude Code native hook timeout to the production
SessionStarthook. This makes Claude Code fail open if launchingentire hooks claude-code session-startstalls before theentireprocess reaches Go code.the reported hang is not specific to hook stdin parsing or the
session-starthandler:entire --versioncan also hang in the affected environment, and the sample shows the process stuck in_dyld_start. That means Cobra, hook parsing, logging, and any internal Go timeout have not started yet.code changes
timeoutsupport to Claude Code hook entries.SessionStarthooks withtimeout: 5.timeout: 5onto existing Entire-owned productionSessionStarthooks when hooks are reinstalled.why this approach
because the failure can happen before Go
main()starts, the timeout needs to live outside the childentireprocess. Claude Code per-hooktimeoutis the right boundary: it can cancel the stalled hook launch and continue startup instead of waiting indefinitely.this keeps the mitigation small and avoids adding a separate shell watchdog or changing the hook command shape.
test plan
go test ./cmd/entire/cli/agent/claudecodego test ./cmd/entire/cli/agent/...mise run lintrelease notes