What happened
On code agent run 32661006970 for issue #6539, the agent correctly understood the docs-only task, created branch agent/6539-consolidate-pi-docs, made all the right edits using the Edit tool (reducing the guide from 891 to 588 lines), and staged files with git add. It then ran pre-commit run --files ... which failed because the sandbox network policy blocks outbound connections (pre-commit needs network to install hook environments). The agent recovered by running individual lint hooks (lint-docs-links, lychee --offline) directly — which passed — but never executed git commit. The session ended after 55 turns. The post-code script found zero commits on the branch and reported "No changed files in agent's commit(s)." The human author (waynesun09) then manually created PR #6540 with equivalent changes. Cost: $3.06 with zero output.
What could go better
The agent's commit workflow broke down when pre-commit run failed: it handled the validation step (running individual lints) but lost track of the commit step. Confidence: high — the run log clearly shows edits made, files staged, pre-commit failure, manual lint recovery, then session end with no git commit. Two complementary fixes would prevent this: (1) the code agent definition should include explicit guidance about committing changes even when pre-commit hooks fail in the sandbox, since the post-code script runs pre-commit hooks outside the sandbox as a safety net; (2) the post-code script could detect uncommitted staged changes and warn about them, providing a defense-in-depth signal. Existing issues #1866, #1997, #3746, and #5263 all address pre-commit hook failures at the post-script level, but none cover the upstream cause: the code agent itself failing to commit staged changes inside the sandbox after a pre-commit framework failure.
Proposed change
Two changes in fullsend-ai/agents:
-
agents/code.md — Add explicit guidance in the code agent definition's commit workflow section: when pre-commit run fails due to sandbox restrictions (network, missing tools), the agent should still commit its changes using git commit --no-verify (or equivalent), because the post-code script runs pre-commit hooks outside the sandbox as a safety gate. The agent should not end its session with staged-but-uncommitted changes. A concrete instruction like: "If pre-commit hooks fail due to sandbox constraints, verify your changes manually (run available linters directly), then commit with --no-verify. The post-code script re-runs hooks outside the sandbox before creating the PR."
-
scripts/post-code.sh — Add a diagnostic check: after extracting the agent's working tree, if there are zero commits on the agent branch but git diff --cached or git status shows staged or modified files, log a warning like "Agent left uncommitted changes — possible pre-commit recovery failure" and include it in the status comment. This provides visibility into the failure mode even if the agent definition fix is incomplete.
Validation criteria
The next 3 code agent runs in fullsend-ai/fullsend that encounter a pre-commit hook failure in the sandbox should still produce commits with the agent's changes. The post-code script should not report "No changed files" when the agent's working tree contains meaningful edits. If the post-code diagnostic is implemented, any future occurrence of this failure mode should produce a visible warning in the status comment rather than a silent "no changes" outcome.
Generated by retro agent from fullsend-ai/fullsend#6540
What happened
On code agent run 32661006970 for issue #6539, the agent correctly understood the docs-only task, created branch
agent/6539-consolidate-pi-docs, made all the right edits using the Edit tool (reducing the guide from 891 to 588 lines), and staged files withgit add. It then ranpre-commit run --files ...which failed because the sandbox network policy blocks outbound connections (pre-commit needs network to install hook environments). The agent recovered by running individual lint hooks (lint-docs-links,lychee --offline) directly — which passed — but never executedgit commit. The session ended after 55 turns. The post-code script found zero commits on the branch and reported "No changed files in agent's commit(s)." The human author (waynesun09) then manually created PR #6540 with equivalent changes. Cost: $3.06 with zero output.What could go better
The agent's commit workflow broke down when
pre-commit runfailed: it handled the validation step (running individual lints) but lost track of the commit step. Confidence: high — the run log clearly shows edits made, files staged, pre-commit failure, manual lint recovery, then session end with nogit commit. Two complementary fixes would prevent this: (1) the code agent definition should include explicit guidance about committing changes even when pre-commit hooks fail in the sandbox, since the post-code script runs pre-commit hooks outside the sandbox as a safety net; (2) the post-code script could detect uncommitted staged changes and warn about them, providing a defense-in-depth signal. Existing issues #1866, #1997, #3746, and #5263 all address pre-commit hook failures at the post-script level, but none cover the upstream cause: the code agent itself failing to commit staged changes inside the sandbox after a pre-commit framework failure.Proposed change
Two changes in
fullsend-ai/agents:agents/code.md— Add explicit guidance in the code agent definition's commit workflow section: whenpre-commit runfails due to sandbox restrictions (network, missing tools), the agent should still commit its changes usinggit commit --no-verify(or equivalent), because the post-code script runs pre-commit hooks outside the sandbox as a safety gate. The agent should not end its session with staged-but-uncommitted changes. A concrete instruction like: "If pre-commit hooks fail due to sandbox constraints, verify your changes manually (run available linters directly), then commit with--no-verify. The post-code script re-runs hooks outside the sandbox before creating the PR."scripts/post-code.sh— Add a diagnostic check: after extracting the agent's working tree, if there are zero commits on the agent branch butgit diff --cachedorgit statusshows staged or modified files, log a warning like "Agent left uncommitted changes — possible pre-commit recovery failure" and include it in the status comment. This provides visibility into the failure mode even if the agent definition fix is incomplete.Validation criteria
The next 3 code agent runs in fullsend-ai/fullsend that encounter a pre-commit hook failure in the sandbox should still produce commits with the agent's changes. The post-code script should not report "No changed files" when the agent's working tree contains meaningful edits. If the post-code diagnostic is implemented, any future occurrence of this failure mode should produce a visible warning in the status comment rather than a silent "no changes" outcome.
Generated by retro agent from fullsend-ai/fullsend#6540