Skip to content

fix(#489): replace network-dependent git commands in skill - #591

Merged
rh-hemartin merged 3 commits into
mainfrom
agent/489-sandbox-git-commands
Aug 5, 2026
Merged

fix(#489): replace network-dependent git commands in skill#591
rh-hemartin merged 3 commits into
mainfrom
agent/489-sandbox-git-commands

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Replaces git commands in the code-implementation skill that depend on network access blocked by the sandbox policy:

  • Branch creation (step 5): Removed git fetch origin and origin/<target-branch> from git checkout -b. The sandbox already checks out the default branch at its latest commit, so HEAD is the correct base — no fetch needed.
  • Changed-file discovery (step 9c): Replaced git diff --name-only origin/<target-branch> with git diff --name-only HEAD. Origin refs may not exist without a successful fetch.

Added explanatory notes at each location documenting the sandbox constraint so future editors understand why these patterns differ from typical git workflows.

Context

In run 30339994159, the agent could not discover the default branch and the post-code script rejected the output. PR #488 addresses the default branch discovery (problem 1 in the issue); this PR addresses the remaining two problems (branch creation and diff commands).

Testing

  • This is a markdown instruction file — no code tests apply.
  • Verified no remaining git fetch origin commands in the modified sections.
  • Verified the replacement commands (git checkout -b without origin ref, git diff --name-only HEAD) are sandbox-compatible.
  • gitlint passed on the commit message.

Closes #489

Post-script verification

  • Branch is not main/master (agent/489-sandbox-git-commands)
  • Secret scan passed (gitleaks — c8d9d827d794064bab0c5f30d6ed702c8c1a4df0..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 31, 2026 07:30
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Jul 31, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:32 AM UTC · Completed 7:47 AM UTC
Commit: 3b84d7c · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] skills/code-implementation/SKILL.md — This file is under the skills/ protected path. The PR links to issue fix(code-implementation): branch discovery and git fetch incompatible with sandbox network policy #489 and clearly explains the rationale for the change (replacing sandbox-incompatible git commands). Human approval is always required for protected-path changes, regardless of context.

  • [stale-command-reference] skills/fix-review/SKILL.md:235 — The command git log --oneline "origin/${BASE_BRANCH}..HEAD" in the fix-review skill uses an origin/ ref that will fail in the sandbox for the same reason this PR fixes in the code-implementation skill. Consider filing a follow-up issue to address this.

Low

  • [architectural-assumption] skills/code-implementation/SKILL.md:269 — The changes rely on the sandbox checking out the default branch as a named local branch (not detached HEAD). This assumption is well-evidenced by the issue description and the sandbox's documented behavior, but cannot be verified within this repository alone. The post-script's auto-correction provides a safety net.

  • [solution-divergence] skills/code-implementation/SKILL.md:576 — The PR uses git diff --name-only <target-branch> rather than the git diff HEAD~<n> approach suggested in issue fix(code-implementation): branch discovery and git fetch incompatible with sandbox network policy #489. The chosen approach is arguably superior (captures the complete delta regardless of commit count), but the divergence from the issue's suggestion is worth noting.

Previous run

Review

Findings

High

  • [logic-error] skills/code-implementation/SKILL.md:576 — Step 9c replaces git diff --name-only origin/<target-branch> with git diff --name-only HEAD. This is semantically incorrect for the existing-branch path (step 4 → skip to step 9). On that path, HEAD is the tip of the feature branch with prior commits, so git diff --name-only HEAD returns only uncommitted working-tree changes — potentially nothing if no fixes were needed. The agent cannot identify which packages to run targeted tests on. The correct replacement is git diff --name-only <target-branch> (the local ref discovered in step 3), which shows all files different between the target branch and the working tree regardless of commit state — consistent with the step 4 fix in this same PR.
    Remediation: Change git diff --name-only HEAD to git diff --name-only <target-branch>.

Medium

  • [incorrect-documentation] skills/code-implementation/SKILL.md:579 — The explanatory text states: "This lists both staged and unstaged changes relative to the branch point." This is factually incorrect. HEAD is not the branch point — it is the current commit. On the existing-branch path (step 4), HEAD is the feature branch tip, and the command would miss all previously committed changes. Update the text when correcting the command.

  • [protected-path] skills/code-implementation/SKILL.md — This file is under the skills/ protected path. The PR links to issue fix(code-implementation): branch discovery and git fetch incompatible with sandbox network policy #489 and clearly explains the rationale for the change (replacing sandbox-incompatible git commands). Human approval is always required for protected-path changes, regardless of context.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (2)

Review

Findings

Medium

  • [protected-path] skills/code-implementation/SKILL.md — This file is under the skills/ protected path. The PR links to issue fix(code-implementation): branch discovery and git fetch incompatible with sandbox network policy #489 and clearly explains the rationale for the change (replacing sandbox-incompatible git commands). Human approval is always required for protected-path changes, regardless of context.

  • [stale-reference] skills/code-implementation/SKILL.md:241 — Step 4's existing-branch handling still uses origin/<target> in git log --oneline origin/<target>..HEAD and git diff origin/<target>..HEAD --stat (lines 241–242). These commands will fail in the sandbox for the same reason this PR fixes the step 5 and step 9c occurrences — origin refs may not be available when the sandbox network policy blocks git protocol access. Consider filing a follow-up issue to address these remaining sandbox-incompatible commands in step 4.


Labels: PR modifies a skill definition file (skills/code-implementation/SKILL.md) and was authored by the code agent bot

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment documentation Improvements or additions to documentation code-agent labels Jul 31, 2026
@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix rebase and address feedback

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ❌ Failure · Started 9:01 AM UTC · Completed 9:06 AM UTC
Commit: 3b84d7c · View workflow run →

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

⚠️ Post-fix script failed — Signed-off-by rejected (exit code 1)

The fix agent completed, but the post-fix script failed before finishing.

Workflow run: https://github.com/fullsend-ai/.fullsend/actions/runs/30618287563

Details:
Agent commit contains a Signed-off-by trailer. Agents must not use 'git commit -s' or append Signed-off-by trailers.
Please check the workflow logs for full details and retry with /fs-fix if appropriate.

@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix rebase, address feedback do not sign-off-by the commit, otherwise the post-fix script will reject your contribution.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ❌ Failure · Started 7:08 AM UTC · Completed 7:13 AM UTC
Commit: 3b84d7c · View workflow run →

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

⚠️ Post-fix script failed — Signed-off-by rejected (exit code 1)

The fix agent completed, but the post-fix script failed before finishing.

Workflow run: https://github.com/fullsend-ai/.fullsend/actions/runs/30792497738

Details:
Agent commit contains a Signed-off-by trailer. Agents must not use 'git commit -s' or append Signed-off-by trailers.
Please check the workflow logs for full details and retry with /fs-fix if appropriate.

@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix rebase, address feedback do not sign-off-by the commit, otherwise the post-fix script will reject your contribution.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ❌ Failure · Started 9:32 AM UTC · Completed 9:36 AM UTC
Commit: 3b84d7c · View workflow run →

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

⚠️ Post-fix script failed — Signed-off-by rejected (exit code 1)

The fix agent completed, but the post-fix script failed before finishing.

Workflow run: https://github.com/fullsend-ai/.fullsend/actions/runs/30801784467

Details:
Agent commit contains a Signed-off-by trailer. Agents must not use 'git commit -s' or append Signed-off-by trailers.
Please check the workflow logs for full details and retry with /fs-fix if appropriate.

@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix rebase, address feedback do not sign-off-by the commit, otherwise the post-fix script will reject your contribution.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 7:23 AM UTC · Completed 7:29 AM UTC
Commit: 3b84d7c · View workflow run →

The code-implementation skill instructed agents to run
`git fetch origin` and diff against `origin/<target-branch>`,
both of which require git protocol access that the sandbox
network policy blocks.

Branch creation (step 5): removed `git fetch origin` and
`origin/<target-branch>` from `git checkout -b`. The sandbox
checks out the default branch at its latest commit, so HEAD
is already the correct base.

Changed-file discovery (step 9c): replaced
`git diff --name-only origin/<target-branch>` with
`git diff --name-only HEAD`. Origin refs may not be
available without a successful fetch.

Note: pre-commit could not run in-sandbox (exit 3, network
error fetching hook environments). The post-script runs
pre-commit authoritatively on the runner.

Closes #489
Step 4's existing-branch handling used origin/<target> in
git log and git diff commands. These fail in the sandbox
because the network policy blocks git protocol access to
github.com, so origin refs may not be available.

Replace origin/<target> with the local <target-branch> ref
discovered in step 3, consistent with the approach already
used in steps 5 and 9c.

Addresses review feedback on #591
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Rebased branch on main. Fixed stale origin/ references in step 4 (lines 269-270) that would fail in the sandbox. Added explanatory note matching the pattern already used in steps 5 and 9c. The protected-path finding is informational and requires human reviewer action.

Fixed (1):

  1. stale origin/ references in step 4 (skills/code-implementation/SKILL.md): Replaced origin/ with local ref in step 4's git log and git diff commands, and added explanatory note consistent with steps 5 and 9c

Disagreed (1):

  1. protected-path requires human approval: This is informational — the file is under skills/ which requires human approval. The fix agent cannot grant human approval; a human reviewer must approve the PR.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-coder
fullsend-ai-coder Bot force-pushed the agent/489-sandbox-git-commands branch from 3b84d7c to bf814f6 Compare August 5, 2026 07:29
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 5, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:29 AM UTC · Completed 7:44 AM UTC
Commit: bf814f6 · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot removed the requires-manual-review Review requires human judgment label Aug 5, 2026
@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 7:46 AM UTC · Completed 7:50 AM UTC
Commit: bf814f6 · View workflow run →

Step 9c's changed-file discovery used `git diff --name-only HEAD`,
which on the existing-branch path (step 4 -> step 9) only shows
uncommitted working-tree changes — not the full set of files
changed on the feature branch. Replaced with
`git diff --name-only <target-branch>` to match the step 4 fix in
this PR and correctly list all files differing from the target
branch. Updated the explanatory text to accurately describe the
command's behavior.

Addresses review feedback on #591
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 2 (human-triggered)

Addressed 2 of 3 review findings (1 high logic-error, 1 medium incorrect-documentation). The third finding (protected-path) is informational — human approval is required per policy. Changed step 9c to use <target-branch> instead of HEAD for changed-file discovery, consistent with the step 4 fix in this PR. Updated explanatory text to accurately describe the command.

Fixed (2):

  1. Step 9c git diff --name-only HEAD is semantically incorrect for the existing-branch path (skills/code-implementation/SKILL.md): Replaced git diff --name-only HEAD with git diff --name-only <target-branch> to correctly list all files differing from the target branch, including previously committed changes on the feature branch. HEAD only shows uncommitted working-tree changes on the existing-branch path.
  2. Explanatory text incorrectly describes HEAD as the branch point (skills/code-implementation/SKILL.md): Rewrote the explanatory text to accurately describe the corrected command: it shows all files that differ between the target branch and the working tree, including previously committed changes. Added sandbox constraint note consistent with the step 4 fix.

Disagreed (1):

  1. Protected-path: skills/code-implementation/SKILL.md requires human approval: This is informational, not actionable by the fix agent. The PR already modifies this file by design (issue fix(code-implementation): branch discovery and git fetch incompatible with sandbox network policy #489 scope). Human approval is required per protected-path policy and has been requested by the PR author via /fs-fix.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 5, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:51 AM UTC · Completed 8:10 AM UTC
Commit: a0ba28b · View workflow run →

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review August 5, 2026 08:10

Superseded by updated review

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.

Comment thread skills/code-implementation/SKILL.md
Comment thread skills/code-implementation/SKILL.md
@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 5, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 599914e Aug 5, 2026
20 checks passed
@rh-hemartin
rh-hemartin deleted the agent/489-sandbox-git-commands branch August 5, 2026 08:30
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 5, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 8:32 AM UTC · Completed 8:43 AM UTC
Commit: a0ba28b · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #591 — Replace network-dependent git commands in code-implementation skill

Timeline

  1. Jul 28 — Issue #489 filed, triage agent correctly identified blocking dependency on PR fix(#483): defer target_branch until after default branch discovery #488.
  2. Jul 31 07:22/fs-code triggered. Code agent created PR with commit c28b8cd3: fixed steps 5 and 9c but missed step 4's identical origin/<target> references and introduced a logic error in step 9c (used HEAD instead of <target-branch>).
  3. Jul 31 07:47 — Review 1 caught step 4 miss ([medium] stale-reference). Valid finding.
  4. Jul 31 09:01 → Aug 3 09:32 — Three consecutive /fs-fix attempts all failed due to a Signed-off-by false positive in post-fix.sh. The agent never added Signed-off-by — the bug was that SCAN_RANGE (PRE_AGENT_HEAD..HEAD) after a rebase includes upstream commits with legitimate human DCO trailers.
  5. Aug 5 07:23 — Fourth /fs-fix succeeded (post-fix.sh had been updated between Aug 3–5). Fixed step 4 origin/ refs.
  6. Aug 5 07:44 — Review 2 caught [high] logic-error in step 9c (HEAD vs <target-branch>) and [medium] incorrect-documentation. Both valid.
  7. Aug 5 07:46 — Fifth /fs-fix succeeded. Fixed step 9c and documentation.
  8. Aug 5 08:10 — Review 3 found [medium] stale-command-reference in fix-review/SKILL.md (out-of-scope cross-file concern), plus low-severity informational findings.
  9. Aug 5 08:25 — Human approved. Merged at 08:30.

What went well

  • Review quality was excellent. All findings across 3 reviews were valid. Review 1 caught the code agent's omission (step 4 refs). Review 2 caught a genuine logic error the fix agent introduced (step 9c). Review 3 identified a cross-file concern in a different skill. Zero false positives.
  • Fix agent resolved actual code issues correctly once the Signed-off-by false positive was cleared. Two fix iterations to address two distinct review findings is reasonable.

What went poorly

  • Three wasted fix cycles due to the post-fix.sh SCAN_RANGE bug after rebase. The bug is still present in the current main branch (scripts/post-fix.sh lines 599–620). This is tracked by #318 and fullsend#5419 — this retro provides additional evidence: the bug caused 3 consecutive failures over 5 days and required 4 human retry interventions.
  • Code agent missed related instances of the pattern it was fixing. Step 4's origin/<target> refs are in the same file as steps 5 and 9c, and serve the same purpose. This is covered by existing issues: #587 (verify fix completeness across similar code sites) and fullsend#3439 (scan full file for all instances of a bug pattern).

Novel finding

The review agent identified that skills/fix-review/SKILL.md line 235 contains origin/${BASE_BRANCH} — the same sandbox-incompatible pattern that PR #591 fixed in code-implementation. No existing issue tracks this. See proposal below.

Proposals filed

ben-alkov pushed a commit to ben-alkov/agents that referenced this pull request Aug 6, 2026
…view skills

fix-review/SKILL.md: Replace origin/${BASE_BRANCH} with the local
${BASE_BRANCH} ref in the strategy-escalation diff range (line 235).
The sandbox checks out the base branch at its latest commit, so the
local ref is already current and origin refs may not be available.

code-review/SKILL.md and docs-review/SKILL.md: Replace the standalone
origin/HEAD branch discovery with gh repo view as the primary method,
keeping origin/HEAD as a fallback with error suppression. Confirmed
that git rev-parse --abbrev-ref origin/HEAD fails in the sandbox
(origin/HEAD is not set), while gh repo view works.

This is the same class of bug that fullsend-ai#489 documented and PR fullsend-ai#591 fixed
in the code-implementation skill.

Closes fullsend-ai#670
ggallen pushed a commit that referenced this pull request Aug 19, 2026
Step 4's existing-branch handling used origin/<target> in
git log and git diff commands. These fail in the sandbox
because the network policy blocks git protocol access to
github.com, so origin refs may not be available.

Replace origin/<target> with the local <target-branch> ref
discovered in step 3, consistent with the approach already
used in steps 5 and 9c.

Addresses review feedback on #591
ggallen pushed a commit that referenced this pull request Aug 19, 2026
Step 9c's changed-file discovery used `git diff --name-only HEAD`,
which on the existing-branch path (step 4 -> step 9) only shows
uncommitted working-tree changes — not the full set of files
changed on the feature branch. Replaced with
`git diff --name-only <target-branch>` to match the step 4 fix in
this PR and correctly list all files differing from the target
branch. Updated the explanatory text to accurately describe the
command's behavior.

Addresses review feedback on #591
ggallen pushed a commit that referenced this pull request Aug 19, 2026
fix-review/SKILL.md: Replace origin/${BASE_BRANCH} with the local
${BASE_BRANCH} ref in the strategy-escalation diff range (line 235).
The sandbox checks out the base branch at its latest commit, so the
local ref is already current and origin refs may not be available.

code-review/SKILL.md and docs-review/SKILL.md: Replace the standalone
origin/HEAD branch discovery with gh repo view as the primary method,
keeping origin/HEAD as a fallback with error suppression. Confirmed
that git rev-parse --abbrev-ref origin/HEAD fails in the sandbox
(origin/HEAD is not set), while gh repo view works.

This is the same class of bug that #489 documented and PR #591 fixed
in the code-implementation skill.

Closes #670
ggallen pushed a commit to ggallen/agents that referenced this pull request Aug 19, 2026
Step 4's existing-branch handling used origin/<target> in
git log and git diff commands. These fail in the sandbox
because the network policy blocks git protocol access to
github.com, so origin refs may not be available.

Replace origin/<target> with the local <target-branch> ref
discovered in step 3, consistent with the approach already
used in steps 5 and 9c.

Addresses review feedback on fullsend-ai#591
ggallen pushed a commit to ggallen/agents that referenced this pull request Aug 19, 2026
… ref

Step 9c's changed-file discovery used `git diff --name-only HEAD`,
which on the existing-branch path (step 4 -> step 9) only shows
uncommitted working-tree changes — not the full set of files
changed on the feature branch. Replaced with
`git diff --name-only <target-branch>` to match the step 4 fix in
this PR and correctly list all files differing from the target
branch. Updated the explanatory text to accurately describe the
command's behavior.

Addresses review feedback on fullsend-ai#591
ggallen pushed a commit to ggallen/agents that referenced this pull request Aug 19, 2026
…view skills

fix-review/SKILL.md: Replace origin/${BASE_BRANCH} with the local
${BASE_BRANCH} ref in the strategy-escalation diff range (line 235).
The sandbox checks out the base branch at its latest commit, so the
local ref is already current and origin refs may not be available.

code-review/SKILL.md and docs-review/SKILL.md: Replace the standalone
origin/HEAD branch discovery with gh repo view as the primary method,
keeping origin/HEAD as a fallback with error suppression. Confirmed
that git rev-parse --abbrev-ref origin/HEAD fails in the sandbox
(origin/HEAD is not set), while gh repo view works.

This is the same class of bug that fullsend-ai#489 documented and PR fullsend-ai#591 fixed
in the code-implementation skill.

Closes fullsend-ai#670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-agent documentation Improvements or additions to documentation ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(code-implementation): branch discovery and git fetch incompatible with sandbox network policy

1 participant