Skip to content

fix: remove ready-for-review label from post-code.sh - #393

Merged
ralphbean merged 2 commits into
mainfrom
agent/391-remove-double-trigger-label
Apr 30, 2026
Merged

fix: remove ready-for-review label from post-code.sh#393
ralphbean merged 2 commits into
mainfrom
agent/391-remove-double-trigger-label

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

The code agent's PR creation flow fired two events that both matched dispatch-review: pull_request_target:opened from gh pr create, and issues:labeled from the subsequent gh pr edit --add-label. This caused a redundant workflow dispatch that wasted compute and a GitHub App token.

Remove the ready-for-review label addition from post-code.sh entirely:

  • Remove PR_LABEL variable and gh label create call
  • Remove gh pr edit --add-label for existing PRs
  • Remove --label flag from gh pr create for new PRs

The pull_request_target:opened event already triggers dispatch-review for automated PR creation. The ready-for-review label remains available for manual /review triggers by humans.

Note: make lint could not run (pre-commit network error in sandbox). Go tests could not run (go not available in sandbox). The change is a shell script deletion only — no Go code was modified.

Closes #391

Changed files

  • internal/scaffold/fullsend-repo/scripts/post-code.sh

Closes #391

Post-script verification

  • Branch is not main/master (agent/391-remove-double-trigger-label)
  • No protected paths modified
  • Secret scan passed (gitleaks — 7e5a9400d9813c304cc20bb1f41750b2549dad1e..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Created by fullsend code agent

@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Apr 23, 2026
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://a1d64140-site.fullsend-ai.workers.dev

Commit: 75bc5b441e8a627e4bb23e7bb0a742089bd971b5

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

Review: #393

Head SHA: 75bc5b4
Timestamp: 2026-04-23T21:00:00Z
Outcome: approve

Summary

Clean, well-scoped deletion that directly addresses the double-trigger bug described in #391. The change removes all three ready-for-review label operations from post-code.sh (label creation, label-on-edit for existing PRs, and --label on gh pr create). The pull_request_target:opened event in the shim workflow independently triggers dispatch-review, so automated review dispatch is unaffected. The ready-for-review label remains available for manual /review triggers by humans. No orphaned variables, no behavioral side effects beyond the intended fix.

Findings

No findings.

Footer

Outcome: approve
This review applies to SHA 75bc5b441e8a627e4bb23e7bb0a742089bd971b5. Any push to the PR head clears this review and requires a new evaluation.

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

The fix is correct — removing the ready-for-review label from post-code.sh eliminates the double-trigger of dispatch-review. The pull_request_target:synchronize event covers the existing-PR re-trigger case, so no review dispatch is lost.

Two items to address:

  1. Stale docs (request changes): Several docs still describe the code agent applying the ready-for-review label — these should be updated in this PR.
  2. Label creation gap (note): The gh label create call was removed. The label should be created during repo scaffolding instead — tracked for a follow-up.

# ---------------------------------------------------------------------------
export GH_TOKEN="${PUSH_TOKEN}"

PR_LABEL="ready-for-review"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ready-for-review label creation (gh label create) was removed here. This means the label won't be pre-created with its description and color for repos that haven't seen a code agent run before the old version. Consider ensuring the label is created during repo scaffolding/installation instead. (Deferring to a follow-up is fine.)

@ralphbean

Copy link
Copy Markdown
Member

Stale documentation: The following docs still describe the code agent applying the ready-for-review label, which is no longer true after this change. Please update them in this PR:

  • docs/guides/user/bugfix-workflow.md — "Labels ready-for-review."
  • docs/ADRs/0002-initial-fullsend-design.md — "When checks are green: add ready-for-review."
  • docs/architecture.md — "advances handoff to Review (ready-for-review)"

The handoff now happens implicitly via pull_request_target events rather than explicit labeling.

@rh-hemartin

Copy link
Copy Markdown
Member

Who is the reponsible for this PR? @waynesun09 @ralphbean ?

fullsend-code and others added 2 commits April 30, 2026 12:58
The code agent's PR creation flow fired two events that both matched
dispatch-review: pull_request_target:opened from gh pr create, and
issues:labeled from the subsequent gh pr edit --add-label. This caused
a redundant workflow dispatch that wasted compute and a GitHub App
token.

Remove the ready-for-review label addition from post-code.sh entirely:
- Remove PR_LABEL variable and gh label create call
- Remove gh pr edit --add-label for existing PRs
- Remove --label flag from gh pr create for new PRs

The pull_request_target:opened event already triggers dispatch-review
for automated PR creation. The ready-for-review label remains available
for manual /review triggers by humans.

Note: make lint could not run (pre-commit network error in sandbox).
Go tests could not run (go not available in sandbox). The change is a
shell script deletion only — no Go code was modified.

Closes #391
…ispatch

The code agent no longer applies the ready-for-review label. Review
dispatch is now triggered by pull_request_target events (PR opened,
synchronize, ready_for_review) rather than explicit labeling. Update
bugfix-workflow.md, ADR 0002, and architecture.md to reflect this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ralphbean
ralphbean force-pushed the agent/391-remove-double-trigger-label branch from 2b3b7ab to e9a2c64 Compare April 30, 2026 16:58
@fullsend-ai-review

fullsend-ai-review Bot commented Apr 30, 2026

Copy link
Copy Markdown

Review: #393

Head SHA: e9a2c64
Timestamp: 2026-04-30T00:00:00Z
Outcome: approve

Summary

This PR correctly eliminates the double-dispatch bug described in #391. The post-code.sh script previously applied the ready-for-review label after PR creation, which fired an issues:labeled event that matched dispatch-review alongside the pull_request_target:opened event — causing two review workflow dispatches for a single PR. The fix removes the label creation (gh label create), the label addition for existing PRs (gh pr edit --add-label), and the --label flag from gh pr create. The pull_request_target trigger in fullsend.yaml (line 89) already handles automated dispatch, so the label is only needed for manual /review invocations. The three documentation files (ADR 0002, architecture.md, bugfix-workflow.md) are updated accurately to reflect that review dispatch is now event-driven rather than label-driven for automated flows. The label remains available for manual use, and all remaining references to it in the codebase (glossary, workflow triggers, ADR label tables) correctly describe its continued role.

Findings

No critical, high, medium, low, or info findings.

Correctness: The shell script deletions are clean — no dangling references to PR_LABEL remain, and the gh pr create call is syntactically correct without the --label flag. The existing-PR path now simply reports the PR exists, which is correct since the push itself triggers pull_request_target:synchronize.

Intent alignment: The change matches issue #391 exactly (Option A). Documentation updates are in scope — they describe the behavioral change accurately.

Platform security: No token handling changes. No new permissions or capabilities introduced. The PUSH_TOKEN flow is unchanged.

Content security: No user content handling changes.

Injection defense: PR body, commit messages, and code comments inspected — no prompt injection patterns, non-rendering Unicode, or suspicious directives found.

Style/conventions: Shell script changes follow existing patterns. Documentation updates are consistent with the surrounding prose style.

Footer

Outcome: approve
This review applies to SHA e9a2c64423ba275f14ab93f592e29d0166f59605. Any push to the PR head clears this review and requires a new evaluation.

Previous run

Review: automated review

Outcome: failure
Reason: stale-head

The review agent reviewed commit 2b3b7ab3a615e06fff8cfa13cc70ff54c2a32205 but the PR HEAD is now e9a2c64423ba275f14ab93f592e29d0166f59605. This review was discarded to avoid approving unreviewed code.

@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 above for full details.

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review feedback addressed — docs updated to reflect pull_request_target-based review dispatch.

@ralphbean
ralphbean added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 853a88b Apr 30, 2026
6 checks passed
@ralphbean
ralphbean deleted the agent/391-remove-double-trigger-label branch April 30, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: code agent PR creation double-triggers dispatch-review

2 participants