Skip to content

feat(hooks): bound 11 unlimited-timeout hooks with appropriate caps#638

Merged
notque merged 1 commit into
mainfrom
feat/evolve-hook-timeout-caps
May 11, 2026
Merged

feat(hooks): bound 11 unlimited-timeout hooks with appropriate caps#638
notque merged 1 commit into
mainfrom
feat/evolve-hook-timeout-caps

Conversation

@notque
Copy link
Copy Markdown
Owner

@notque notque commented May 11, 2026

Summary

  • Evolution cycle proposal: Add timeout caps to all 11 hooks previously missing timeout values
  • Consensus score: 3.0/3.0 (Pragmatist: STRONG, Purist: STRONG, User Advocate: STRONG)
  • A/B result: 4/4 tests pass (100% improvement, zero regressions)

Changes

  • .claude/settings.json: Added timeout to 11 hooks — graduated by hook criticality:
    • sync-to-user-claude.py: 20000ms (expensive file sync: 119 skills + 45 agents)
    • session-context.py: 5000ms (learning DB query)
    • cross-repo-agents.py: 3000ms (directory scan)
    • posttool-lint-hint.py: 3000ms (lightweight file check)
    • agent-grade-on-change.py: 5000ms (agent quality analysis)
    • record-activation.py: 2000ms (stats write)
    • posttool-session-reads.py: 2000ms (file tracking write)
    • error-learner.py: 3000ms (DB write)
    • record-waste.py: 2000ms (DB write)
    • precompact-archive.py: 5000ms (session archiving)
    • session-summary.py: 10000ms (summary generation)

Test Results

Test Case Result
No unlimited-timeout hooks remain PASS
No regressions on previously-bounded hooks PASS
Exactly 11 hooks received timeout caps PASS
Timeout graduation: sync(20s) > session(5s) > cross-repo(3s) PASS

Evidence

15+ learning DB timeout entries at 0.70 confidence; "SessionStart: 5/8 hooks with timeout ≤3000ms" diagnostic entry.

Evolution Cycle

This PR was generated and validated by the toolkit-evolution skill (2026-05-11 nightly cycle).

Add timeout values to every hook that previously had none, eliminating
the class of indefinite session stall caused by hooks that hang on slow
I/O, DB queries, or filesystem operations.

Timeout strategy (graduated by hook criticality):
- SessionStart sync (sync-to-user-claude.py): 20000ms — expensive file sync
- SessionStart session-context.py: 5000ms — learning DB query
- SessionStart cross-repo-agents.py: 3000ms — directory scan
- PostToolUse posttool-lint-hint.py: 3000ms — lightweight file check
- PostToolUse agent-grade-on-change.py: 5000ms — agent quality analysis
- PostToolUse record-activation.py: 2000ms — stats write
- PostToolUse posttool-session-reads.py: 2000ms — file tracking write
- PostToolUse error-learner.py: 3000ms — DB write
- PostToolUse record-waste.py: 2000ms — DB write
- PreCompact precompact-archive.py: 5000ms — session archiving
- Stop session-summary.py: 10000ms — summary generation

Evidence: 15+ learning DB timeout entries at 0.70 confidence;
"SessionStart: 5/8 hooks with timeout ≤3000ms" diagnostic entry.
@notque notque merged commit 8923523 into main May 11, 2026
6 checks passed
@notque notque deleted the feat/evolve-hook-timeout-caps branch May 11, 2026 03:21
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