Repository navigation
fix(hooks): run the SessionStart setup check async with a 30 s timeout - #254
Open
vicoociv14 wants to merge 1 commit into
Open
vicoociv14 wants to merge 1 commit into
vicoociv14 wants to merge 1 commit into
Conversation
check-setup.sh starts Python and runs setup.py --check; on some Windows machines (endpoint protection scanning each process) that exceeds the 5 s limit, so every session start waits 5 s and the advisory is killed before it prints. Async keeps start-up unblocked; 30 s lets slow machines finish the check. Claude-Session: https://claude.ai/code/session_01SKjDx6TxCFiCBj3TkvwGrK
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.
Problem
The
SessionStarthook runscheck-setup.sh, which starts a Python interpreter and runssetup.py --check. On some Windows machines that takes longer than the hook's 5-second timeout. Endpoint protection that scans every new process is enough to cause it.When that happens:
Measured on one Windows 11 machine with Git Bash: the hook hit its 5 s timeout on 48 of 48 recorded session starts (the transcript shows
hook_cancelledwithtimedOut: true). Each start took 7–8 s before the kill.Change
hooks/hooks.json:"async": true: the check runs in the background, so a session no longer waits on it.timeoutraised from 5 to 30: a slow machine still finishes the check and gets its advisory, instead of being cut off.The script, its output and its exit codes are unchanged. The hook is advisory only (the script always exits 0), so running it in the background loses nothing.
Testing
The JSON is validated and the script is unchanged. Hook behaviour follows Claude Code's documented
asyncandtimeoutfields. I have no after-measurement on the affected machine yet, so the evidence for the change is the timeout data above.