Skip to content

fix(hooks): honor lifecycle quiescence#432

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
codex/hooks-honor-lifecycle-lease
Jul 10, 2026
Merged

fix(hooks): honor lifecycle quiescence#432
ScriptedAlchemy merged 2 commits into
masterfrom
codex/hooks-honor-lifecycle-lease

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • gate every hook before startup/config/store work with a non-inherited shared lifecycle lease
  • silently quiesce and drain piped hook input while update or migration holds exclusive ownership
  • skip agent-install maintenance for all hook commands

Verification

  • cargo test --test hooks_lsp_suite --locked hook_lifecycle_lease_test
  • cargo test --lib --locked lifecycle_lease::tests
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b2fd149

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2fd149f4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/hook_cmd.rs
Comment on lines +57 to +58
Commands::HookPreToolUse | Commands::HookPromptSubmit | Commands::HookStop => {
Some(HookInput::NoInput)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Drain Claude stdin hooks while quiescing

Claude's hooks reference says command hooks receive the event JSON on stdin, and this repo wires PreToolUse, UserPromptSubmit, and Stop as command hooks in plugin/hooks/hooks-claude.json. Classifying these variants as NoInput makes the new Busy path return without draining them; when an update/migration holds the exclusive lifecycle lease and Claude submits a large prompt/stop payload, Claude can see a broken pipe or hook failure instead of the intended fail-open quiescence. Please treat these as Stdin for the busy drain even if the dispatcher ignores the payload.

Useful? React with 👍 / 👎.

@ScriptedAlchemy ScriptedAlchemy merged commit 22497aa into master Jul 10, 2026
13 checks passed
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