Skip to content

feat(#325): detect workflow file changes in triage and skip code agent#326

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/325-triage-workflow-detection
Open

feat(#325): detect workflow file changes in triage and skip code agent#326
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/325-triage-workflow-detection

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Add workflow modification detection to the triage pipeline so issues requiring GitHub Actions workflow file changes are flagged during triage
  • When requires_workflow_changes: true is set in the triage summary, post-triage.sh applies triaged instead of ready-to-code, preventing the code agent from being auto-dispatched for work it cannot perform
  • Covers all blocked workflow paths: .github/workflows/, .fullsend/.github/workflows/, and enrolled-repo shim workflows

Changes

  • agents/triage.md: Added workflow detection guidance in Phase 3 (assessment), added requires_workflow_changes field to the sufficient action's JSON example, and documented the field's behavior
  • schemas/triage-result.schema.json: Added optional requires_workflow_changes boolean to the triage_summary definition
  • scripts/post-triage.sh: Added workflow-change guard that checks requires_workflow_changes and skips ready-to-code label for bug/documentation/performance categories when set to true
  • scripts/post-triage-test.sh: Added 7 tests covering workflow flag behavior across all auto-promote categories, regression guards for unflagged issues, and warning output verification

Test plan

  • All 7 new workflow detection tests pass
  • All pre-existing tests continue to pass (1 pre-existing infrastructure failure due to missing yq in sandbox — unrelated to this change)
  • Bug with requires_workflow_changes: true → gets triaged, NOT ready-to-code
  • Bug without the flag → still gets ready-to-code (regression guard)
  • Documentation and performance categories also correctly gated
  • Warning annotation emitted when workflow changes detected

Closes #325

Post-script verification

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

Add workflow modification detection to the triage pipeline. When triage
identifies that resolving an issue requires changes to GHA workflow
files (.github/workflows/, .fullsend/.github/workflows/, or shim
workflows), the post-triage script now applies the triaged label
instead of ready-to-code, preventing the code agent from being
auto-dispatched for work it cannot perform.

Changes:
- agents/triage.md: add Phase 3 detection guidance and
  requires_workflow_changes field to triage_summary output
- schemas/triage-result.schema.json: add optional boolean
  requires_workflow_changes to triage_summary definition
- scripts/post-triage.sh: check requires_workflow_changes flag
  and skip ready-to-code for bug/documentation/performance
  categories when set
- scripts/post-triage-test.sh: add 7 tests covering workflow
  flag behavior across categories and regression guards

Closes #325
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 21, 2026 10:15
@rh-hemartin

Copy link
Copy Markdown
Member

/fs-review

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

LGTM

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 22, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:59 AM UTC · Completed 7:15 AM UTC
Commit: 7ada4e0 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] agents/triage.md, scripts/post-triage.sh, scripts/post-triage-test.sh — This PR modifies files under protected paths (agents/, scripts/). The PR links to issue Triage should detect likely GHA workflow modifications and skip automatic code agent #325 and explains the rationale for the changes, but human approval is always required for protected-path changes regardless of context.

  • [stale-doc] docs/triage.md:40 — The ready-to-code label description states it is applied for fully specified and low-risk categories (bug, documentation, performance) but does not mention the new exception: when requires_workflow_changes: true is set in triage results, triaged is applied instead of ready-to-code, preventing auto-dispatch of the code agent.
    Remediation: Add a note to the ready-to-code row explaining the workflow-change exception.

Low

  • [logic-error] scripts/post-triage.sh:321 — The ::warning::Skipping ready-to-code message is emitted before the case statement, firing for all categories when REQUIRES_WORKFLOW == "true". For categories that never receive ready-to-code (feature, other, unknown), the warning is misleading — it implies ready-to-code was about to be applied but was suppressed.
    Remediation: Move the warning inside the bug, documentation, and performance case branches, or gate it with a category condition.

  • [stale-doc] docs/code.md:41 — The ready-to-code label description does not mention the workflow-change exception introduced in this PR.
    Remediation: Update the ready-to-code label description to note the workflow-change exception.


Labels: PR modifies triage agent behavior (agent instructions, post-script, schema, and tests).

@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 scripts/post-triage.sh
# or shim workflows), skip ready-to-code regardless of category. The code
# agent cannot modify workflow files under current permissions.
REQUIRES_WORKFLOW=$(jq -r '.triage_summary.requires_workflow_changes // false' "${RESULT_FILE}")
CATEGORY=$(jq -r '.triage_summary.category // "unknown"' "${RESULT_FILE}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] logic-error

The ::warning::Skipping ready-to-code message is emitted before the case statement, firing for all categories when REQUIRES_WORKFLOW is true. For categories that never receive ready-to-code (feature, other, unknown), the warning is misleading.

Suggested fix: Move the warning inside the bug, documentation, and performance case branches, or gate it with a category condition.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment triage-agent labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-manual-review Review requires human judgment triage-agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Triage should detect likely GHA workflow modifications and skip automatic code agent

2 participants