Skip to content

hooks: add explicit 10s timeout to SessionStart hooks#2020

Open
TotalyNotABotTrustMe wants to merge 1 commit into
obra:devfrom
TotalyNotABotTrustMe:fix/sessionstart-hook-timeout
Open

hooks: add explicit 10s timeout to SessionStart hooks#2020
TotalyNotABotTrustMe wants to merge 1 commit into
obra:devfrom
TotalyNotABotTrustMe:fix/sessionstart-hook-timeout

Conversation

@TotalyNotABotTrustMe

Copy link
Copy Markdown

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

This PR MUST target the dev branch, not main. main is the
released branch; active work lands on dev first. PRs opened against
main will be asked to retarget dev before review.

Who is submitting this PR? (required)

Field Value
Your model + version
Harness + version
All plugins installed
Human partner who reviewed this diff

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

  • I have reviewed all open AND closed PRs for duplicates or prior art
  • Related PRs:

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID

New harness support (required if this PR adds a new harness)

Clean-session transcript for "Let's make a react todo list"
paste the complete transcript here

Evaluation

  • What was the initial prompt you (or your human partner) used to start
    the session that led to this change?
  • How many eval sessions did you run AFTER making the change?
  • How did outcomes change compared to before the change?

Rigor

  • If this is a skills change: I used superpowers:writing-skills and
    completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table,
    rationalizations, "human partner" language) without extensive evals
    showing the change is an improvement

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

What this fixes

Part of #1560.

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.

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

  • Both hooks.json files still parse as valid JSON
  • tests/hooks/test-session-start.sh passes

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
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