Skip to content

fix: keep agent hooks silent without usable python - #2771

Closed
akbash-bot wants to merge 2 commits into
masterfrom
akbash/2769-silent-python-hook-failure
Closed

fix: keep agent hooks silent without usable python#2771
akbash-bot wants to merge 2 commits into
masterfrom
akbash/2769-silent-python-hook-failure

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Summary

  • contain failures when a discoverable python3 cannot start
  • keep Unix agent hooks silent and non-blocking in that environment
  • bump integration assets that had not yet advanced since v0.8.0

Checks

  • cargo test --test cli shell_hooks_ignore_unusable_python_on_path -- --nocapture
  • cargo test --test cli cases::hooks -- --nocapture
  • cargo test bundled_integration_asset_versions_match_expected_versions -- --nocapture
  • sh -n for the seven changed Unix hook assets
  • just check (fmt and clippy pass; nextest is blocked by the unrelated existing live_server_holds_one_pty_master_fd_per_pane replacement-server timeout, also reproducible in isolation)

refs #2769

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 255e534b-6706-479b-ba08-3c6640ce2ff7

📥 Commits

Reviewing files that changed from the base of the PR and between b617644 and ebaf64d.

📒 Files selected for processing (1)
  • tests/cli/hooks.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/cli/hooks.rs

📝 Walkthrough

Walkthrough

The pull request makes Unix hook Python execution silent and non-blocking when it fails. It updates Devin, Grok, and MastraCode integration versions and extends asset consistency and hook fallback tests.

Changes

Hook and integration updates

Layer / File(s) Summary
Integration version synchronization
src/integration/assets/devin/*, src/integration/assets/grok/*, src/integration/assets/mastracode/*, src/integration/mod.rs, src/integration/tests.rs
Devin changes from version 2 to 3. Grok changes from version 1 to 2. MastraCode changes from version 2 to 3. Asset consistency tests include Grok and expect the new MastraCode version.
Silent Python hook fallback
src/integration/assets/{claude,codex,copilot,devin,droid,grok,mastracode}/herdr-agent-state.sh, tests/cli/hooks.rs
Shell hooks redirect Python output to /dev/null and ignore Python failures. Tests verify successful, silent fallback when python3 fails.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to ebaf6

The PR keeps Unix hooks silent when discovered Python cannot start and updates integration assets; no actionable merge-blocking risk remains after normal checks.

Possibly related PRs

  • herdrdev/herdr#2248: Both PRs modify tests/cli/hooks.rs and shell hook invocation behavior.
  • herdrdev/herdr#2496: Both PRs modify Devin, Grok, and MastraCode integration assets, version tracking, and asset tests.
  • herdrdev/herdr#2722: Both PRs modify integration hook scripts and version tracking.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: keeping agent hooks silent when Python is unavailable or cannot start.
Description check ✅ Passed The description directly explains the hook failure handling, integration version updates, tests, and validation results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2769-silent-python-hook-failure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 13, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d4c2238b-e6a0-4261-bca2-feb6e7e7a881

📥 Commits

Reviewing files that changed from the base of the PR and between 952729e and b617644.

📒 Files selected for processing (13)
  • src/integration/assets/claude/herdr-agent-state.sh
  • src/integration/assets/codex/herdr-agent-state.sh
  • src/integration/assets/copilot/herdr-agent-state.sh
  • src/integration/assets/devin/herdr-agent-state.ps1
  • src/integration/assets/devin/herdr-agent-state.sh
  • src/integration/assets/droid/herdr-agent-state.sh
  • src/integration/assets/grok/herdr-agent-state.ps1
  • src/integration/assets/grok/herdr-agent-state.sh
  • src/integration/assets/mastracode/herdr-agent-state.ps1
  • src/integration/assets/mastracode/herdr-agent-state.sh
  • src/integration/mod.rs
  • src/integration/tests.rs
  • tests/cli/hooks.rs

Comment thread tests/cli/hooks.rs
@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown

Greptile Summary

The PR makes seven Unix agent hooks silently tolerate a discoverable but unusable Python interpreter and adds regression coverage for that environment. It also advances the Devin, Grok, and Mastracode integration assets, but leaves four other behaviorally changed assets at their prior versions.

  • Redirects embedded Python output and converts failures into successful hook exits.
  • Adds a Unix test using a failing python3 executable on PATH.
  • Advances and validates selected bundled integration versions.

Confidence Score: 4/5

The integration versions for Claude, Codex, Copilot, and Droid need to be advanced before merging so existing installations actually receive the hook fix.

Four behaviorally changed assets retain their previous version markers, while status and update recommendations rely exclusively on those versions, leaving already-installed hooks on the failing implementation.

Files Needing Attention: src/integration/assets/{claude,codex,copilot,droid}/herdr-agent-state.sh and src/integration/mod.rs

Important Files Changed

Filename Overview
src/integration/assets/claude/herdr-agent-state.sh Silences Python startup failures, but the unchanged integration version prevents existing installations from receiving the fix.
src/integration/assets/codex/herdr-agent-state.sh Applies the silent-failure behavior without advancing the asset version.
src/integration/assets/copilot/herdr-agent-state.sh Applies the silent-failure behavior without advancing the asset version.
src/integration/assets/droid/herdr-agent-state.sh Applies the silent-failure behavior without advancing the asset version.
src/integration/mod.rs Advances Devin, Grok, and Mastracode versions but omits corresponding bumps for four other changed hook assets.
tests/cli/hooks.rs Adds focused Unix regression coverage proving all seven changed hooks remain silent and return success with an unusable python3.
src/integration/tests.rs Extends bundled version consistency coverage to Grok and updates the expected Mastracode version.

Reviews (1): Last reviewed commit: "test: gate shell hook regression on unix" | Re-trigger Greptile

Comment thread src/integration/assets/claude/herdr-agent-state.sh
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 13, 2026
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.

3 participants