fix(#577): disable in-repo git hooks inside sandbox - #578
fix(#577): disable in-repo git hooks inside sandbox#578fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Target repo git hooks (e.g., Husky commit-msg) fire inside the sandbox during agent commits and can inject Signed-off-by trailers. The post-scripts reject these trailers, making the agents incompatible with Husky-based repositories like Kaiden and Podman Desktop. Add `git config --global core.hooksPath /dev/null` to both the code-implementation and fix-review skills. This prevents all in-repo hooks from running inside the sandbox. The post-scripts already run hooks authoritatively on the runner, so in-sandbox hooks are redundant. In code-implementation, updated the step 10 hook guidance to reference the proactive disabling rather than the reactive --no-verify fallback. Closes #577
|
🤖 Finished Review · ✅ Success · Started 9:05 PM UTC · Completed 9:19 PM UTC |
ReviewFindingsMedium
Low
Labels: PR modifies skills for both the code-implementation and fix-review agents |
| @@ -761,11 +770,12 @@ Repeat until gitlint passes. Do not leave a commit that you know will | |||
| fail CI. If gitlint is not available, manually verify that no line in | |||
There was a problem hiding this comment.
[medium] logic-error
Step 10 states 'Git hooks are disabled in step 5 (core.hooksPath /dev/null)' as a blanket precondition, but step 4's existing-branch path ('Skip to step 9') bypasses step 5 entirely. When an agent reuses a branch, core.hooksPath is never set to /dev/null, making the step 10 assertion false for that code path. The --no-verify fallback is documented but framed as a rare edge case rather than the expected path.
Suggested fix: Move 'git config --global core.hooksPath /dev/null' to step 3 (always runs), or add it to the step 4 existing-branch path before skipping to step 9.
| 1. Read `CLAUDE.md`, `CONTRIBUTING.md`, `AGENTS.md` if they exist. | ||
| 2. Discover test and lint commands from `Makefile`, `package.json`, etc. | ||
| 3. Check for linter config (`.golangci.yml`, `.pre-commit-config.yaml`, etc.). | ||
| 4. **Disable in-repo git hooks.** The sandbox is ephemeral and the |
There was a problem hiding this comment.
[low] internal-consistency
fix-review's step 8 (Commit) has no mention that hooks are disabled or a --no-verify fallback, unlike code-implementation's step 10 which was explicitly updated. The missing fallback guidance means an agent has no documented recovery if hooks fire despite the disable.
Suggested fix: Add a brief note to fix-review step 8 analogous to code-implementation step 10: 'Hooks are disabled in step 3. If a hook fires despite this, commit with --no-verify.'
| echo "::notice::STEP 5: Create branch" | ||
| ``` | ||
|
|
||
| **Disable in-repo git hooks.** The sandbox is ephemeral and the post-script |
There was a problem hiding this comment.
[low] formatting-consistency
The hook-disabling prose block is inserted between the STEP 5 progress marker and the branch creation commands, placing preparatory infrastructure before the step's primary operation.
Suggested fix: Move the hook-disabling section to appear after the branch creation commands or before the step marker.
Summary
Disable in-repo git hooks inside the agent sandbox by adding
git config --global core.hooksPath /dev/nullto both the code-implementation and fix-review skills.Target repo git hooks (e.g., Husky's
commit-msghook with DCO sign-off) fire inside the sandbox during agent commits and injectSigned-off-bytrailers. The post-scripts (post-code.shsection 3b,post-fix.shsection 1b) reject commits containing these trailers, making agents incompatible with Husky-based repositories.Changes:
skills/code-implementation/SKILL.md: Added hook disabling instruction to step 5 (Create branch), before any commit operations. Updated step 10 hook guidance to reference proactive disabling rather than only the reactive--no-verifyfallback.skills/fix-review/SKILL.md: Added hook disabling as step 3.4 (Discover repo conventions), before implementation begins.Rationale: The sandbox is ephemeral and the post-scripts already run hooks authoritatively on the runner. In-sandbox hooks are redundant and, in this case, actively harmful. Disabling via
core.hooksPathcovers all hook frameworks (Husky, lefthook, raw.git/hooks/), not just Husky.Testing
make testpasses (1 pre-existing failure inpost-triage-test.shunrelated to this change)Closes #577
Post-script verification
agent/577-disable-sandbox-hooks)93b7178526a4dd58b8d77a3035731b6345896614..HEAD)