hooks: add explicit 10s timeout to SessionStart hooks#2020
Open
TotalyNotABotTrustMe wants to merge 1 commit into
Open
hooks: add explicit 10s timeout to SessionStart hooks#2020TotalyNotABotTrustMe wants to merge 1 commit into
TotalyNotABotTrustMe wants to merge 1 commit into
Conversation
The SessionStart hook blocks session start (async: false in the Claude Code config) but had no explicit timeout in hooks/hooks.json or hooks/hooks-cursor.json, so it silently relied on each platform's default (600s for Claude Code). If the hook ever hung, that's up to a 10-minute stall on every session start with no explanation. The hook just reads one file and does string escaping, so it should finish in milliseconds. Set an explicit 10s timeout on both configs so a hang fails fast instead of silently eating minutes. Refs obra#1560
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.
The SessionStart hook blocks session start (async: false in the Claude Code config) but had no explicit timeout in hooks/hooks.json or hooks/hooks-cursor.json, so it silently relied on each platform's default (600s for Claude Code). If the hook ever hung, that's up to a 10-minute stall on every session start with no explanation.
The hook just reads one file and does string escaping, so it should finish in milliseconds. Set an explicit 10s timeout on both configs so a hang fails fast instead of silently eating minutes.
Refs #1560
Who is submitting this PR? (required)
What problem are you trying to solve?
What does this PR change?
Is this change appropriate for the core library?
What alternatives did you consider?
Does this PR contain multiple unrelated changes?
Existing PRs
Environment tested
New harness support (required if this PR adds a new harness)
Clean-session transcript for "Let's make a react todo list"
Evaluation
the session that led to this change?
Rigor
superpowers:writing-skillsandcompleted adversarial pressure testing (paste results below)
rationalizations, "human partner" language) without extensive evals
showing the change is an improvement
Human review
What this fixes
Part of #1560.
The SessionStart hook blocks session start (
async: falsein the Claude Code config) but had no explicittimeoutinhooks/hooks.jsonorhooks/hooks-cursor.json, so it silently relied on each platform's default (600s for Claude Code). If the hook ever hung, that's up to a 10-minute stall on every session start with no explanation.The hook just reads one file and does string escaping, so it should finish in milliseconds. Set an explicit 10s timeout on both configs so a hang fails fast instead of silently eating minutes.
What this doesn't cover
#1560 also mentions "descriptions are uniform" and "one skill is large" (writing-skills/SKILL.md is 679 lines vs. the next-largest at 503). The issue body was empty, so I didn't want to guess at what "descriptions are uniform" means — happy to take a pass at the skill-size part separately if useful, or if a maintainer can clarify the other one.
Testing
tests/hooks/test-session-start.shpasses