Skip to content

fix(hooks): log external command failures - #2772

Open
030611 wants to merge 1 commit into
MoonshotAI:mainfrom
030611:fix/hook-failure-diagnostics-2766
Open

fix(hooks): log external command failures#2772
030611 wants to merge 1 commit into
MoonshotAI:mainfrom
030611:fix/hook-failure-diagnostics-2766

Conversation

@030611

@030611 030611 commented Aug 10, 2026

Copy link
Copy Markdown

Related Issue

Resolve #2766

Problem

External hooks fail open by design, but command launch errors, timeouts, and unexpected non-zero exits currently leave no diagnostic. This makes a broken hook configuration look the same as a hook that was never triggered.

What changed

  • emit a warning through the existing diagnostic logger in both hook engines
  • include the hook event, configured command, exit status or timeout state, and the first stderr line
  • preserve fail-open behavior and keep exit code 2 as an intentional block without a warning
  • add regression coverage for unexpected failures and intentional blocks

Validation

  • TypeScript checks for agent-core and agent-core-v2
  • agent-core-v2 import-boundary check
  • focused hook suites: 101 passed, 6 skipped
  • new diagnostics regressions: 4 passed

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a27472

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

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

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.

Hook command spawn failures are completely silent — no log, no diagnostic, kimi doctor reports OK

1 participant