Repository navigation
skills(notifications): add in-flight-run check to dedup gate - #322
Merged
Merged
Conversation
The bundled step 4a dedup check finds *completed* bot activity (comments, reviews, timeline cross-references). It does not see a dedicated workflow that is still running — and `tend-mention` sessions that involve real implementation routinely run past the 10-minute freshness gate. When the notifications bot proceeds, it duplicates in-progress work. Observed on worktrunk run 24742688091 (~79 min / ~$25 re-implementing PR #2361 while tend-mention was still pushing) and historical run 24519963858 (~16 min / ~$9 duplicating PR #2263). Add an in-flight check to step 4a that queries `actions/runs?status=in_progress`, matching on `display_title` (the workflow_run payload does not expose the triggering issue number for issue_comment / pull_request_review events). On hit, skip without marking read — same behavior as the freshness gate, so the next scheduled poll picks it up when the dedicated run resolves. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The heredoc-specific ! rewriting was fixed in #317, but the Bash tool can still rewrite bare bangs outside heredocs, so the overlay's `(X) | not` form is still the safer construction when authoring jq via bash. Revert to that and re-document the caveat. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
tend-agent
approved these changes
Apr 22, 2026
Drop incident-specific references and over-qualified rationale. Keep the check, the display_title note, and the two bash-tool caveats — these are the only load-bearing pieces. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 22, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 23, 2026
## Summary PR #322 relied on a precedence rule that CLAUDE.md stated but the skills didn't fully cover: bundled-skill defects should go to tend (not to per-repo overlays), but the rule didn't say *how* a bot should do that across a trust boundary. This PR codifies the routing. When a correction identifies a gap in a bundled skill (same root cause would fire in every consumer), the bot opens a permission-request issue in the consuming repo; on maintainer approval, the bot files the same issue in tend. The maintainer, not the bot, authorizes cross-repo filings — consuming repos may be private. ## Changes - `plugins/tend-ci-runner/skills/running-in-ci/SKILL.md` — new "Bundled-skill defects: ask permission to file in tend" subsection under "Learning from Feedback," with signals and what to include in the request. - `plugins/tend-ci-runner/skills/review-runs/SKILL.md` — Step 6 exception covering the same routing when findings come from run review rather than interactive feedback. - `CLAUDE.md` — consolidated to development directions. Dropped the "Skill precedence: repo > bundled" section (product-runtime content that now lives in the skills). Added "Skill design: bundled for everyone, overlay for one" — a directive for developers writing skills in this repo about what belongs in each tier. ## Test plan - [x] `pre-commit run --all-files` - [ ] Next time a bundled-skill defect surfaces autonomously, verify the bot opens a permission-request issue in the consuming repo rather than patching the overlay or filing directly against tend. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upstreams the fix from worktrunk PR max-sixty/worktrunk#2386 into the bundled notifications skill.
Step 4a of the dedup check currently finds completed bot activity (comments, reviews, timeline cross-references). It does not see a dedicated workflow that is still running.
tend-mentionsessions that involve real implementation routinely run past the 10-minute freshness gate — when the notifications bot proceeds, it re-implements in-progress work.Evidence (from worktrunk, finding in #2386):
Change
Adds an In-flight check sub-step to step 4a of
plugins/tend-ci-runner/skills/notifications/SKILL.md, sitting between the freshness gate and the dedup check. It queriesactions/runs?status=in_progress, filters totend-*runs, excludes$GITHUB_RUN_ID, and matches ondisplay_title(the workflow_run payload does not expose the triggering issue number forissue_comment/pull_request_reviewevents without an extra API call per run). On hit, skip without marking read — same disposition as the freshness gate.The two bash-tool caveats from the overlay are preserved inline:
gh api --jqdoes not accept--arg/--argjson, and the Bash tool's bang rewriting can still bite outside heredocs, so the jq uses(X) | notrather than the not-equal operator.Why this lives in tend, not as a per-repo overlay
The precedence rule codified in CLAUDE.md ("Skill precedence: repo > bundled") and in
running-in-ci/SKILL.md(#306) says overlays are for repo-specific policy/convention/taste. This fix is generic: any tend consumer whosetend-mentionruns can exceed 10 minutes will hit the same race. That makes it a bundled-skill defect, not an overlay.Follow-up on worktrunk
Once this lands, worktrunk#2386 is redundant — the bundled skill now covers what its overlay added. A human should close #2386 and revert the overlay section it added to
.claude/skills/running-tend/SKILL.md. I have not touched worktrunk.Test plan
pre-commit run --all-filespassesactions/runs?status=in_progress(returns 0 when no concurrent tend run matches the subject title, which is the current state)tend-mentionrun, verify a concurrent notifications run seesIN_PROGRESS > 0and exits cleanly