Skip to content

Harden Claude UserPromptSubmit context timeout#403

Merged
screenleon merged 2 commits into
mainfrom
feat/CC-492-userprompt-context-timeout
Jul 15, 2026
Merged

Harden Claude UserPromptSubmit context timeout#403
screenleon merged 2 commits into
mainfrom
feat/CC-492-userprompt-context-timeout

Conversation

@screenleon

Copy link
Copy Markdown
Owner

Summary

  • give the managed Claude UserPromptSubmit context hook a 150-second outer timeout
  • distinguish incomplete zero-row context databases from normal refreshes so interrupted initial builds recover correctly
  • migrate the managed .gate-results permission from Write(...) to Edit(...)
  • make uninstall remove both the current Edit(...) entry and the historical managed Write(...) entry while preserving unrelated /tmp/* permissions
  • extend Claude doctor diagnostics, documentation, affected-suite routing, and regression coverage

Root cause

Claude command hooks default to a 30-second timeout, while the context injector already allowed longer internal refresh and initial-build budgets. An interrupted initial context build could also leave an existing database with zero indexed files, causing later invocations to select the shorter refresh path. The outer hook could therefore terminate before the injector completed and discard its output.

Impact

The managed context hook now has enough time for its bounded initial-build path, interrupted zero-row databases recover on the next prompt, and installer permission entries use the Claude-compatible Edit spelling. Existing unrelated /tmp/* permissions remain user-managed.

Validation

  • affected regression runner: 9 suites passed
  • focused installer, doctor, guard, and runner tests passed
  • live Claude doctor: 26 OK, 0 warnings, 0 failures
  • live JapanJob prompt hook: completed successfully in 12.77 seconds; context index fresh with 1320 files
  • sequential full Codex gate: GO (gate-20260715-003400-ab8888)
  • full suite: 76 suites passed; one test-pmctl-context isolation assertion was invalidated by a concurrent session refreshing the live context DB
  • isolated rerun of scripts/test-pmctl-context.sh: 114 passed, 0 failed
  • git diff --check and backlog lint passed

@screenleon screenleon marked this pull request as ready for review July 15, 2026 01:03
@screenleon screenleon merged commit 41d4a25 into main Jul 15, 2026
49 checks passed
@screenleon screenleon deleted the feat/CC-492-userprompt-context-timeout branch July 15, 2026 01:03
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