Skip to content

refactor(actions): clear every agent:* request label through clear-request-label - #245

Draft
azlekov wants to merge 1 commit into
mainfrom
refactor/clear-request-label
Draft

azlekov wants to merge 1 commit into
mainfrom
refactor/clear-request-label

Conversation

@azlekov

@azlekov azlekov commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Closes #244.

What

A new composite action, actions/clear-request-label, is now the only code that removes an agent:* request label.

  • The label name is percent-encoded before it goes in the URL.
  • A 404 is silent, because the label was already gone.
  • Any other failure emits ::warning title=<label> not removed::#N keeps <label>, so the request stays on ….
  • The step never fails. It runs in clean-up steps, and a failing clean-up would turn a refusal red and hide the refusal's own message.
  • number takes one or more whitespace-separated numbers, which is what pr-iterate's conflict relay needs.
Caller Label Condition (unchanged)
pr-review.yml agent:review always()
issue-decompose.yml agent:decompose always()
issue-implement.yml gate agent:implement as before: on a refusal, or a stopped gate on its own labeled event. The check step now sets clear=true, and the step right after it removes the label
issue-implement.yml report agent:implement always(), now its own step after the report
pr-iterate.yml decide agent:iterate land, handoff, give-up, relay, with the App token as before. It runs before act, so a relay's re-add is still a fresh labeled event
pr-iterate.yml conflict relay agent:iterate every dirty PR is cleared before the re-add loop
pr-iterate.yml update hand-off agent:iterate always() && pushed != 'true'
actions/judge-verdict/verdict.sh agent:judge calls ../clear-request-label/clear.sh directly, because its sweep clears from inside a loop (the same pattern as dependency-check calling agent-gate/gate.sh)

Why

GitHub emits no labeled event for a label that is already on, so a request label that never comes off can't be asked for again. Most of the hand-written copies ended in || true, which made a 403 look like "label absent". pr-review printed "agent:review was not on this PR" for any failure at all.

Not changed

deps-verify.yml around L845 removes the deps:verified / deps:fixed / deps:needs-manual verdict labels. Those are records, not requests, and deps-verify never removes agent:review, so it stays out of this PR.

Pending: issue-triage

issue-triage.yml's "Clear the request label" step only exists in #243, which is still open. Once #243 merges, this branch will be rebased on it and that step switched to the action, with if: always() && (!cancelled() || github.event.action == 'labeled') and number inputs.issue-number || github.event.issue.number. This PR stays a draft until then. After the rebase, the test.sh guard fails until that step is converted.

Tests

  • actions/clear-request-label/test.sh stubs gh and covers:
    • success, 404 and 403
    • several numbers where one fails
    • a label with a slash or a space
    • a non-numeric number, an empty label and an empty number
    • that action.yml passes each input through
    • a repo-wide guard that fails on any agent:* removal written outside the action. Against main it flags all seven hand-written sites.
  • hk check --all passes.
  • Every python check in self-test.yml, run locally with PYTHONPATH=.github/selftest: 42 of 42 pass, the same result as on main.
  • Every actions/*/test.sh and scripts/*.test.sh passes locally.

The new action is referenced as @v1, like every internal ref. The channel commit pins it to the release that adds it.

🤖 Generated with Claude Code

…quest-label

One composite action now removes a request label: percent-encoded, a 404 is silent, any other
failure is a ::warning that the request stays on, and the step never fails. pr-review,
issue-implement, issue-decompose and pr-iterate call it with their own `if:`; judge-verdict calls
its clear.sh from inside its sweep loop.

Why: the hand-written copies had drifted, most to `|| true`, so a 403 read as "label absent". GitHub
emits no labeled event for a label already present, so a silently failed removal is a request that
can never be made again.
Rejected: routing deps-verify's removals here. Those are deps:* verdict labels, records rather than
requests, and deps-verify never removes agent:review.
Refs: #244

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.

chore: clear every agent:* request label through one shared action

1 participant