Skip to content

fix(mention): keep both halves of the 👀 reaction in one job - #990

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-989
Aug 15, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-989

Conversation

@tend-agent

@tend-agent tend-agent commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

tend-mention put the 👀 on in verify and took it off in handle. always() on the remove step only governs step execution within a job that started — a job cancelled while still queued allocates no runner and runs no steps at all. handle's cancel-in-progress: false holds a running job; GitHub still evicts a pending one when a newer run arrives (workflow-syntax). So a burst of three mentions on one thread evicts run 2's pending handle after its verify already reacted, leaving a 👀 that claims a session is working with no session and nothing left to remove it. Eviction is the routine path; any route where handle never starts (a verify failure after the react, an environment-protection refusal) has the same shape. review and triage were never exposed — both halves are steps of one job there.

Separately, the remove step listed reactions with no --paginate, so it read only the first 30. On review and triage the target is the issue/PR itself, where 👀 is also the ordinary "watching this" reaction — past 30 of them the bot's own falls off page 1, REACTION_ID comes back empty, and the step exits 0 having silently kept the reaction.

Both bugs strand the same signal, so they're fixed together.

Solution

Move react_eyes into handle as its first step, matching review and triage: the eyes can only go on once the job that removes them has started. Its if: drops the should_run conjunct (the job's own if already carries it) and reads needs.verify.outputs.reason instead of steps.check.outputs.reason.

Add --paginate (and per_page=100) to the reaction lookup in unreact_eyes; the existing --jq filter and head -n1 already handle the rest.

Of the issue's three options this is #1. #3 (queue: max) would run every queued session instead of dropping the redundant ones — a cost change, not a fix.

The trade this makes

What a user sees changes, and not only by a few seconds. On an idle thread the 👀 now lands after verify finishes rather than at the end of it — seconds, on a signal that already lags the comment by the length of verify. On a busy thread — the burst case this fix exists for — handle queues behind the in-flight session under tend-mention-handle-<number> with cancel-in-progress: false, so the second mention's 👀 waits out that whole session, and a third mention evicts the queued handle before it ever reacts, leaving the second comment with no acknowledgment at all. Before this change that comment got its 👀 immediately — stranded, which is the bug.

That's the intended trade: 👀 means "a session is working on this right now", and under the new placement it is never claimed falsely. Silence on a queued comment is recoverable — the handling prompt already tells the session to pick up other unaddressed comments on the thread — whereas a stranded 👀 is a standing false claim nothing clears.

Testing

test_eyes_come_off_when_the_session_ends now asserts the invariant the bug violated — that exactly one job in each workflow carries eyes steps — plus --paginate on the lookup. Both assertions fail on the old templates (mention: the eyes are split across {'handle', 'verify'}; triage/review: the reaction lookup only reads the first page) and pass after. Regtest snapshots regenerated; full Python suite green (554 passed).

The generated tend-*.yaml in this repo are untouched — they track the released generator and update on the nightly regen.


Closes #989 — automated triage

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The fix is right and lands at the right depth — the invariant now lives in the macro comment and in an assertion (reacting == {job}) rather than in a per-workflow convention, so a future split fails a test instead of stranding reactions. --paginate on the lookup is the only way to reach the bot's own reaction on a busy thread, since the delete needs a reaction id and there's no "delete my reaction" endpoint. I rendered the mention/review/triage workflows (Claude and Codex) and ran actionlint 1.7.12 over them — clean, including the new block-scalar if: and the reworked run: under shellcheck. The regtest snapshots match exactly the set of templates that render eyes steps.

One thing the description understates. "The reaction now lands after verify finishes rather than at the end of it — a few seconds" holds only for an unqueued mention. In the burst case — the one the fix exists for — handle sits behind an in-flight session under tend-mention-handle-<number> with cancel-in-progress: false, so the second mention's 👀 now waits out the whole first session, and a third mention evicts that queued handle before it ever reacts, leaving the second comment with no acknowledgment at all. Previously it got one immediately (stranded, which is the bug).

I think that's the correct trade — 👀 means "a session is working on this right now", and under the new placement it is never claimed falsely, whereas silence on a queued comment is recoverable via the prompt's "handle any other unaddressed comments too". But it's a visible change to what a user sees on a busy thread, not a few seconds of latency, and worth stating that way in the description so the trade is signed off knowingly rather than discovered later.

@tend-agent

Copy link
Copy Markdown
Collaborator Author

Fair — "a few seconds" only described the idle case, and the burst case is the one the fix exists for. Rewrote the description: the latency claim now covers both, and a The trade this makes section states plainly that a queued mention's 👀 waits out the in-flight session and a third mention can evict it before it ever reacts, so that comment gets no acknowledgment where it previously got a stranded one.

No code change — the placement is still the right one, and the argument for it is now in the description rather than implied.

@max-sixty
max-sixty merged commit cb366a7 into main Aug 15, 2026
9 checks passed
@max-sixty
max-sixty deleted the fix/issue-989 branch August 15, 2026 14:55
@max-sixty max-sixty mentioned this pull request Aug 16, 2026
max-sixty added a commit that referenced this pull request Aug 16, 2026
Bumps the generator to 0.1.18 and adds the CHANGELOG section the release
workflow publishes as the GitHub Release notes.

8 commits since 0.1.17. The two fixes: `repo-secret-allowlist` now
reports only the org secrets the repo can actually read, instead of
flagging every org secret as available to all workflows (#994); and both
halves of the 👀 reaction sit in one job on `tend-mention`, with a
paginated removal lookup (#990). Two bundled-skill changes go out with
them — `running-in-ci` scopes PR-description claims to the merge base
(#992), and tells a fork-PR session that no successor will pick up its
own review's findings (#985).

`uv run pytest` (564), the worker's vitest suite (31) and typecheck, and
`pre-commit run --all-files` all pass on the branch.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 17, 2026
Automated nightly regeneration of tend's workflow files, picking up tend
0.1.18.

**tend version:** 0.1.17 → 0.1.18

Notable changes:

- `tend-mention`: both halves of the 👀 reaction now live in the `handle`
job. Previously `verify` added the eyes and `handle` removed them, so a
burst of mentions on one thread could cancel a queued `handle` — which
allocates no runner and runs no steps, `always()` included — leaving the
reaction stranded (max-sixty/tend#990).
- `tend-review` / `tend-triage`: the eyes-removal lookup now paginates
(`--paginate`, `per_page=100`). A thread with more than 30 reactions
could push the bot's own eyes off the first page, so the removal
silently found nothing (max-sixty/tend#990).
- `tend check`: the secret audit now reports only org secrets this repo
can actually read, instead of every org secret (max-sixty/tend#994).
- `running-in-ci` skill: notes that fork PR reviews reach no successor
session, and scopes PR-description claims to the merge base
(max-sixty/tend#985, max-sixty/tend#992).

Full comparison:
max-sixty/tend@0.1.17...0.1.18

Co-authored-by: worktrunk-bot <[email protected]>
max-sixty added a commit that referenced this pull request Aug 17, 2026
Post-release regeneration for 0.1.18. The eight generated workflows move
to the `max-sixty/tend/[email protected]` pin, and `review-reviewers.yaml`
is restamped by hand, since `init` never rewrites it.

Beyond the pin, the 👀 reaction fix from #990 lands here:
`tend-mention`'s `React with eyes` moves out of `verify` and becomes
`handle`'s first step, so a queued `handle` evicted by a later mention
on the same thread can no longer strand a reaction with no session
behind it. The removal lookup in all three reacting workflows now
paginates at `per_page=100`, so the bot's own 👀 is still found on an
issue carrying more than 30 of them.

`pre-commit run --files .github/workflows/*.yaml` passes, actionlint
included.

> _This was written by Claude Code on behalf of max-sixty_
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.

tend-mention: 👀 is added in verify but removed in handle, so a handle evicted while queued strands the reaction

2 participants