Skip to content

fix(run-agent,issue-triage): run triage on the agent:triage label, and fail when the agent never ran - #243

Open
azlekov wants to merge 1 commit into
mainfrom
fix/agent-label-trigger
Open

azlekov wants to merge 1 commit into
mainfrom
fix/agent-label-trigger

Conversation

@azlekov

@azlekov azlekov commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #242.

agent:triage now runs triage. A run where claude-code-action skips itself warns, and fails the triage job. The label is cleared on every path.

Cause

issue-triage sets track-progress, so claude-code-action runs in tag mode. Tag mode re-checks the trigger even with a prompt. On issues/labeled it compares the label to label_trigger, default claude, and on a mismatch it skips itself and reports success. Agent mode does not check, so only triage was affected.

Changes

  • run-agent passes the routed event's own label as label_trigger, only when a prompt is set. The gate already chose the label. In pure tag mode the label is the request, so the default stays.
  • run-agent warns Agent never ran on a self-skip and sets a new self-skipped output. It still writes no Agent run notice, since a skip is not a run. skipped keeps its meaning (workflow-mismatch), because deps-verify reads it that way.
  • run-agent gains fail-on-self-skip (default false). With it, a self-skip fails the step. An edited or deleted comment is not a self-skip: the action refuses it by design, ahead of any trigger.
  • issue-triage sets fail-on-self-skip. Its Triage state check alone cannot catch a skip, because an issue triaged before keeps its old state. That is how the broken run passed.
  • issue-triage clears agent:triage in a final step instead of asking the agent to. Only a 404 is silent; any other failure warns that the request stays on. A cancelled run clears it only when the label started it, so a run superseded by the labeled one does not strip its label, while a timed-out labeled run still frees it.
  • AGENTS.md and README record the tag-mode check, the output and the input.

Tests

actions/run-agent/test.sh: 126 passed, 0 failed. The new cases failed before the fix, and a mutation check confirmed that each guards its line:

  • the outcome step warns and sets self-skipped=true on a self-skip, not on a failure, not on an edited comment, and does on a new comment
  • label_trigger carries the routed label, fail-on-self-skip defaults off and fails the last step, and triage sets it
  • the clear step runs last with the cancel rule above, and, run for real against a stubbed gh, stays quiet on success and on a 404 and warns on a 403

hk check --all is clean.

Rollout

The fix reaches the canary repos on @next on merge, and everyone else after Promote. To verify, apply agent:triage to a test issue in a canary repo. Triage should run and set Triage state, and the label should disappear.

🤖 Generated with Claude Code

…d fail when the agent never ran

Tag mode re-checks the trigger even with a prompt, and on issues/labeled compares the label to
label_trigger, default `claude`. issue-triage runs in tag mode for its progress comment, so the
agent:triage label skipped the agent and the job passed green.

- run-agent passes the routed event's own label as label_trigger when a prompt is set.
- run-agent warns "Agent never ran" on a self-skip, sets a new self-skipped output, and fails
  with a new fail-on-self-skip input. An edited or deleted comment is refused by design, not a skip.
- issue-triage sets fail-on-self-skip: an issue triaged before keeps its old Triage state, so the
  state check alone passed a run that never happened.
- issue-triage clears agent:triage in a final step instead of asking the agent to. Only a 404 is
  silent, and a cancelled run clears it only when the label started it.

Closes #242

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(run-agent,issue-triage): agent:triage label skips the agent and passes green

1 participant