feat: code agent post-script and provider - #1
Closed
ben-alkov wants to merge 5 commits into
Closed
Conversation
ben-alkov
force-pushed
the
feat/code-agent-post-script
branch
from
April 17, 2026 13:32
2155c47 to
5f1bded
Compare
Automation layer that takes the code agent's local commit from the sandbox and turns it into a pushed branch and PR. Three files: harness YAML, provider YAML, and a post-script shell script. Depends on repo extraction (in-flight) and PR fullsend-ai#231 (fullsend run CLI). Assisted-by: Claude Code (Opus 4.6)
Pushes the agent feature branch and opens a PR that auto-closes the originating issue. Runs on the host after sandbox teardown with access to the extracted repo and GH_TOKEN. Assisted-by: Claude Code (Sonnet 4.6)
Wires the code agent to the GitHub provider, post-script, and runner env vars (ISSUE_NUMBER, REPO_FULL_NAME). References agents/code.md and policies/code.yaml which are out of scope for this change. Assisted-by: Claude Code (Sonnet 4.6)
Maps FULLSEND_CODE_BOT_TOKEN to GH_TOKEN on the host side. The token is used by the post-script for push and PR creation and never enters the sandbox (ADR-0017). Assisted-by: Claude Code (Opus 4.6)
Assisted-by: Claude Code (Opus 4.6)
ben-alkov
force-pushed
the
feat/code-agent-post-script
branch
from
April 22, 2026 23:13
5f1bded to
60a334c
Compare
ben-alkov
pushed a commit
that referenced
this pull request
May 18, 2026
When a human submits a PR and the review agent requests changes, the fix agent no longer auto-triggers. This is now the default behavior for human-authored PRs. Bot-authored PRs (from the code agent) continue to auto-trigger fixes as before. Humans can opt in to the review-fix loop by adding the `fullsend-fix` label to their PR. The existing `/fs-fix` command for manual invocation is unaffected — it intentionally bypasses this gate so authorized users can always trigger fix regardless of labels. Changes across dispatch paths (reusable dispatcher, per-repo scaffold): - Gate fix dispatch on PR author ending in [bot] OR presence of `fullsend-fix` label - Add defense-in-depth check in reusable-fix.yml that verifies PR author and label before running the fix agent - Add inline comment clarifying /fs-fix bypass (per review feedback) Note: fullsend.yaml shim no longer needs this gate — upstream refactored it to delegate all routing to the reusable dispatch workflow. E2E tested in ascerra-fullsend-lab org (human-pr-fix-test repo): 1. Human PR, no label (PR #1) — fix agent SKIPPED - Review: https://github.com/ascerra-fullsend-lab/.fullsend/actions/runs/25836235094 - Shim skipped dispatch-fix-bot: https://github.com/ascerra-fullsend-lab/human-pr-fix-test/actions/runs/25836370170 2. Human PR, fullsend-fix label (PR #2) — fix agent auto-triggered - Review: https://github.com/ascerra-fullsend-lab/.fullsend/actions/runs/25837485822 - Shim dispatched fix: https://github.com/ascerra-fullsend-lab/human-pr-fix-test/actions/runs/25837620440 - Fix agent succeeded: https://github.com/ascerra-fullsend-lab/.fullsend/actions/runs/25837623950 3. Bot PR, no label (PR fullsend-ai#4, author: ascerra-fullsend-lab-coder[bot]) — fix agent auto-triggered - Code agent created PR: https://github.com/ascerra-fullsend-lab/.fullsend/actions/runs/25838129538 - Review requested changes: https://github.com/ascerra-fullsend-lab/.fullsend/actions/runs/25838396492 - Shim dispatched fix (no label needed): https://github.com/ascerra-fullsend-lab/human-pr-fix-test/actions/runs/25838580565 - Fix agent succeeded: https://github.com/ascerra-fullsend-lab/.fullsend/actions/runs/25838584099 Co-authored-by: Cursor <cursoragent@cursor.com>
ben-alkov
pushed a commit
that referenced
this pull request
Aug 6, 2026
…riables Add HMAC-SHA256 signing of dispatch variables so API-triggered GitLab pipelines can verify the variables were set by the trusted poller, not forged by an attacker. This reduces the residual risk where CI_API_V4_URL override could bypass bot identity verification (mitigation #1). Go poller (dispatch.go): - computeDispatchHMAC() signs canonical key=value pairs using FULLSEND_DISPATCH_SECRET - signedDispatchKeys defines the canonical key list (sorted) - FULLSEND_POLL_JOB_URL included in signed keys - Once-per-run warning when FULLSEND_DISPATCH_SECRET is not set Shell verifier (fullsend-agent.yml): - HMAC verification block for API-triggered pipelines - Secret passed via env var (not command line) to avoid /proc exposure - Constant-time comparison via python3 hmac.compare_digest - Fail-closed: missing HMAC or mismatch aborts the job - Backward compatible: skipped when secret not configured Tests: - Cross-language test executing both Go and python3 HMAC against same test vector to verify identical output - Key list parity test between Go signedDispatchKeys and shell printf - HMAC determinism, tampering detection, missing keys - Integration test covering all signed keys for MR events Closes fullsend-ai#5572 (mitigation #2) Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.fullsend/providers/github.yaml— mapsFULLSEND_CODE_BOT_TOKENtoGH_TOKENon the host side (ADR-0017).fullsend/harness/code.yaml— wires agent, provider, post-script, and runner env vars.fullsend/scripts/post-code.sh— pushes agent feature branch and opens a PR linking to the originating issuedispatch/github/workflows/code.ymlto exportISSUE_NUMBERandREPO_FULL_NAMEDepends on PR fullsend-ai#231 (
fullsend runCLI) and Marta's repo extraction work.Test plan
python3 -c "import yaml, sys; yaml.safe_load(open(sys.argv[1]))" .fullsend/harness/code.yamlpost-code.shrunDir/repo/with a feature branch, set env vars, runpost-code.sh