Skip to content

fix(mention): skip issue_comment events on tend-outage issues - #268

Merged
max-sixty merged 1 commit into
mainfrom
daily/review-runs-24388485336
Apr 14, 2026
Merged

max-sixty merged 1 commit into
mainfrom
daily/review-runs-24388485336

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

The tend-mention workflow entered a self-sustaining feedback loop during a ~80-minute Anthropic API authentication outage (401 invalid bearer token) starting at 2026-04-14T03:03Z. 95 tend-mention runs fired in ~80 minutes, all failing with the same 401 — see run 24379786217 as a representative example.

Root cause

  1. The tend action's Report failure step auto-comments on an issue labeled tend-outage when Claude invocation fails.
  2. The tend-mention verify job runs for every issue_comment event (workflows.py:219).
  3. Under a persistent outage, each failure-report comment re-triggers tend-mention, which also fails, which posts another comment → loop until the outage clears.

#233 removed the comment.user.login != {bn} filter in favor of relying on the prompt's self-loop guard. That works for transient failures, but when the API itself is unreachable, the model never executes — the action fails before Claude starts, so the prompt-level guard is bypassed entirely.

Evidence that this is new/worsened:

Outage issue Created Comments
#162 2026-04-07 2
#171 2026-04-08 4
#184 2026-04-08 6
#267 2026-04-13 301 (after #233 merged 2026-04-10)

Fix

Add a workflow-level guard: skip issue_comment events on issues labeled tend-outage. The label is owned exclusively by the action's Report-failure step (see action.yaml:300) and exists purely for operational tracking, so no legitimate bot responses belong there.

This is a workflow-level filter (not prompt-level), so it holds even when the model is unreachable. actionlint accepts the !contains(github.event.issue.labels.*.name, 'tend-outage') syntax.

Gate assessment

  • Evidence: Critical (clearly wrong outcome — 95 runaway runs, each invoking infrastructure) — 1 occurrence is sufficient.
  • Classification: Structural — same conditions produce the same loop every time the underlying API is unreachable for more than one tend-mention cycle. No model decision involved.
  • Magnitude: Targeted fix — one if: condition + generator regtest updates. Passes both gates.

Test plan

  • uv run pytest passes (158 tests, 16 regtests auto-reset).
  • actionlint validates the regenerated tend-mention.yaml.
  • Verify on next persistent outage that no cascade of tend-mention runs fires.
  • Nightly regeneration picks up the change once the next release ships.

The Report-failure step in action.yaml posts a comment on the
tend-outage tracking issue whenever Claude invocation fails. After
#233 removed the `comment.user.login \!= {bn}` filter, every such
comment re-triggers tend-mention. When the root cause is persistent
(e.g. Anthropic 401 auth outage), tend-mention fails the same way,
posts another comment, and the loop sustains at ~1 run/minute until
the outage clears.

The self-loop guard delegated to the prompt by #233 only runs once
the model is reachable. During an API-layer outage the prompt never
executes, so the guard is bypassed and the workflow-level trigger
fires unconditionally.

Observed on 2026-04-14: 95 tend-mention runs in ~80 min, all failing
with the same 401; issue #267 accumulated 301 comments before the
outage ended. Earlier outage issues (pre-#233) capped at 2-6 comments.

Fix is at the workflow `if:` layer so it holds even when the model is
unreachable. The tend-outage label is owned by action.yaml's
Report-failure step and exists only for operational tracking, so
skipping comment-triggered runs on those issues is safe.
@tend-agent tend-agent added the review-runs Findings from review-runs skill label Apr 14, 2026
@max-sixty
max-sixty merged commit 65f8eb3 into main Apr 14, 2026
3 checks passed
@max-sixty
max-sixty deleted the daily/review-runs-24388485336 branch April 14, 2026 13:56
max-sixty pushed a commit that referenced this pull request Apr 14, 2026
## Summary

Add a second entry to the `review-reviewers` **Non-issues** list so
future
hourly runs don't re-draft sender-based filters for `tend-mention`. The
entry
covers the case where the bot's own `issue_comment` (e.g., posting on a
user
issue where it previously replied, or its own tracking issue) fires
`tend-mention`, which then exits silently via the prompt's
self-conversation
guard.

## Evidence

Three self-trigger runs on `max-sixty/tend` in the past ~2 hours (window
15:18Z–16:17Z on 2026-04-14), each spun up Claude and exited silently:

| Run | Trigger | Cost | Turns |
|---|---|---|---|
|
[24407340908](https://github.com/max-sixty/tend/actions/runs/24407340908)
| `tend-agent` comment on `review-reviewers-tracking` #133 | $0.47 | 12
|
|
[24409523729](https://github.com/max-sixty/tend/actions/runs/24409523729)
| `tend-agent` triage comment on issue #269 | $0.20 | 6 |
|
[24410231240](https://github.com/max-sixty/tend/actions/runs/24410231240)
| `tend-agent` comment on tracking issue #133 | $0.22 | 7 |

All three exit with reasoning like "self-trigger, no role boundary,
exiting
silently" — the prompt-level guard works correctly, just at a few
hundred
tokens of cost per occurrence.

## Why no workflow fix

[#203](#203) ("fix: filter bot
self-triggers in tend-mention workflow") proposed exactly this sender
filter
for `pull_request_review` / `pull_request_review_comment` events on
2026-04-09. @max-sixty closed it without merge or comment, matching the
pattern of earlier closures of authorship-keyed guards
([#154](#154),
[#212](#212)) already called out
in the
non-issues list. Extending the same sender filter to `issue_comment`
would
fit the same rejected shape, so this PR only updates the skill to
prevent
future runs from re-drafting it.

## Gate assessment

- **Evidence level**: High — 3 occurrences this run, structural (every
bot
comment on a participated-in issue fires `tend-mention` verify→handle),
and
  direct prior-art signal (#203 closed by maintainer).
- **Classification**: Structural (deterministic from workflow logic) —
same
  condition always produces the wasted Claude invocation.
- **Change type**: Targeted simplification — adds one bullet to an
existing
  warning list. No workflow or generator changes.
- **Passes both gates**: yes (structural 1+ occurrence sufficient for
  removal/simplification; change is one-paragraph docs).

## Test plan

- [ ] Rendered non-issues list reads sensibly and cites #203 / #268
accurately

Co-authored-by: continuous-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
tend-agent pushed a commit that referenced this pull request Apr 14, 2026
Pulls in PR #268's `tend-outage` skip guard for `tend-mention`
(critical — prevents the outage self-loop) and the freshness-gate /
bot-closed-PR-drop from PR #254 for `tend-notifications`.

Observed on run 24418078692 (review-reviewers, 2026-04-14T19:13Z):
a 3-run cascade hit #267 between 19:14–19:17Z during a brief
Anthropic outage. The cascade only stopped because the API recovered;
the same pattern produced 95 runs in ~80 minutes during the earlier
2026-04-14T03:03Z outage documented in #268. Tend's own
`tend-mention.yaml` was last regenerated at cb6e919 (#236), which
predates #268, so the deployed filter still allows `issue_comment`
events on the `tend-outage` tracking issue.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit that referenced this pull request Apr 14, 2026
## Summary

Regenerates `tend-mention.yaml` and `tend-notifications.yaml` with tend
0.0.12 (released earlier today). The critical change is
[#268](#268 `tend-outage` skip
guard for `tend-mention`, which tend's own deployed workflow has been
missing since that fix landed.

## Evidence — outage loop reproduced today

[Run
24418078692](https://github.com/max-sixty/tend/actions/runs/24418078692)
(review-reviewers, 2026-04-14T19:13:53Z) observed a fresh cascade on
[#267](#267):

| Time (UTC) | Run | Workflow | Result |
|---|---|---|---|
| 19:14:48Z |
[24418118461](https://github.com/max-sixty/tend/actions/runs/24418118461)
| tend-mention | failure → posted to #267 |
| 19:15:49Z |
[24418164746](https://github.com/max-sixty/tend/actions/runs/24418164746)
| tend-mention | failure → posted to #267 |
| 19:16:42Z |
[24418203215](https://github.com/max-sixty/tend/actions/runs/24418203215)
| tend-mention | failure → posted to #267 |
| 19:17:43Z |
[24418247574](https://github.com/max-sixty/tend/actions/runs/24418247574)
| tend-mention | success (Anthropic recovered) |

Each failure ran `action.yaml`'s `Report failure` step
(`action.yaml:296-358`), which POSTed to the `tend-outage`-labeled #267.
That `issue_comment` event re-triggered `tend-mention`, which failed the
same way, producing the next run. The cascade stopped only when the
Anthropic API came back online — the same pattern that produced 95 runs
in ~80 minutes during the 2026-04-14T03:03Z outage documented in
[#268](#268).

## Root cause

[#268](#268) merged the fix into
`generator/src/tend/workflows.py` at 2026-04-14T13:56Z, and
[#270](#270) released 0.0.12. But
tend's own `.github/workflows/tend-mention.yaml` was last regenerated at
cb6e919 ([#236](#236)), which
predates #268. The deployed filter is still:

```yaml
(github.event_name == 'issue_comment') ||
```

which allows every comment on the `tend-outage` issue to re-trigger the
workflow. This PR applies the 0.0.12 generator, which emits the guarded
form:

```yaml
(github.event_name == 'issue_comment' &&
  !contains(github.event.issue.labels.*.name, 'tend-outage')) ||
```

## What's in this regen

- `tend-mention.yaml`:
[#268](#268) `tend-outage` skip
guard.
- `tend-notifications.yaml`:
[#254](#254) freshness gate (Layer
D) + bot-closed-PR drop (Layer C). Already released in 0.0.12;
regenerating brings tend's own workflow in line.

CLAUDE.md authorizes regenerating to the latest release ("Updating
earlier to the latest release (e.g., during a release commit) is fine");
0.0.12 was released today in
[#270](#270).

## Gate assessment

- **Classification**: Structural — same conditions reproduce every time.
An Anthropic outage lasting ≥ ~2 min triggers the cascade with
probability 1 under the current deployed filter.
- **Evidence level**: Critical. 1 occurrence this run + 1 historical
occurrence (95 runs on 2026-04-14T03:03Z, documented in
[#268](#268)). Per
`review-gates.md`, a structural failure with a clear critical outcome
passes Gate 1 at 1 occurrence.
- **Change type**: Mechanical regeneration. No generator or skill
changes — only workflow YAML regenerated from already-merged,
already-released source.
- **Gates**: Pass / Pass.

## Test plan

- [ ] CI green on this PR.
- [ ] On the next Anthropic outage lasting ≥ 2 minutes, `tend-mention`
stays quiet on #267 instead of looping — the cascade can't re-enter
because the `issue_comment` filter now excludes `tend-outage`-labeled
issues.

Co-authored-by: continuous-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
tend-agent added a commit that referenced this pull request Apr 14, 2026
Closes #274

A fix that lands in the generator isn't deployed on tend itself until
.github/workflows/tend-*.yaml is regenerated. PR #268's tend-outage
label filter was merged 2026-04-14T13:56Z and released in 0.0.12 at
17:16Z, but the filter didn't reach tend's deployed workflows until
#273 merged at 20:07Z. During the gap, an Anthropic outage at 19:14Z
triggered the same self-sustaining cascade on #267 that the filter was
meant to prevent. Adding this step to the release workflow closes the
deployment gap on tend itself.

Co-Authored-By: Claude <[email protected]>
max-sixty pushed a commit that referenced this pull request Apr 14, 2026
## Problem

A fix that lands in the `tend` generator isn't deployed on tend itself
until `.github/workflows/tend-*.yaml` is regenerated from the released
version. That regeneration happens nightly, so between a release and the
next nightly run there's a window where tend's own workflows lag the
just-released generator.

For 0.0.12:

- 2026-04-14T13:56Z — PR #268 merged (adds `!contains(labels,
'tend-outage')` filter on `tend-mention.yaml`'s `issue_comment` branch).
- 17:16Z — Release 0.0.12 cut.
- 19:14–19:46Z — Anthropic outage; because tend's deployed
`tend-mention.yaml` was still the pre-#268 version, the self-sustaining
cascade the filter was meant to prevent fired again: 6 `tend-mention`
failures + 1 `tend-notifications` failure posted 7 "Failed run at …"
comments on outage tracking issue #267, each retriggering the next.
- 20:07Z — PR #273 regenerated the workflows; cascade stopped.

Full evidence in #274.

## Solution

Adds a step 10 to `.claude/skills/release/SKILL.md`: after the PyPI
release is live, run `uvx tend@latest init` and open a regeneration PR
(matching #273's format). This closes the post-release deployment gap on
tend itself — consuming repos are unaffected since they already pick up
the new release on their next nightly run.

Aligns with existing CLAUDE.md guidance: *"Updating earlier to the
latest release (e.g., during a release commit) is fine."*

## Testing

- `uvx pre-commit run --all-files` — all hooks pass (skill text change
only, no code).
- Change is two added lines in one markdown file.

---
Closes #274 — automated triage

Co-authored-by: tend-agent <[email protected]>
Co-authored-by: Claude <[email protected]>
tend-agent added a commit that referenced this pull request May 10, 2026
Remove links to specific past PRs (#154, #212, #263, #203, #268, #392, #375, #305, #318) from review-reviewers and running-in-ci, restating each as a structural rule (what shape is accepted, what shape is not). Extend "Authoring skills" in the root CLAUDE.md with a parallel "No specific past-case references" bullet so future skill edits don't re-introduce them.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-runs Findings from review-runs skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants