Skip to content

skills(ci-fix): dedup against recently closed fix/ci-* PRs - #369

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-360
May 2, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-360

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Fixes #360.

Extends the bundled ci-fix skill's existing-fix dedup (Step 1) to also scan recently closed bot-authored fix/ci-* PRs, so a maintainer's rejection rationale ("won't fix", "fix upstream") isn't ignored on the next failure of the same root cause.

The new query uses the head:fix/ci- search qualifier (not --head, which is ignored by the search API path) and requests body in --json so the prior diagnostic is available for shape-matching. Both gotchas are codified in the skill body.

Test plan

  • Generator regtests still pass (uv run pytest).
  • Skill renders cleanly in a future ci-fix invocation that hits a recently rejected workaround.

When a maintainer closes a workaround with a rejection rationale, the
next CI failure re-runs ci-fix and re-derives the same workaround. Extend
Step 1 to scan closed bot-authored fix/ci-* PRs from the last 14 days and
shape-match by failure diagnostic in the PR body, exiting silently when
the prior PR was rejected.

Codifies the two gotchas from #360: closed-state needs the head:fix/ci-
search qualifier rather than --head, and --json must include body.

Fixes #360.

@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.

One inline suggestion on the first gotcha — the technical claim about --head is empirically incorrect (verified with GH_DEBUG=api). The recipe itself works; only the explanation needs correction.


Two gotchas:

- For closed-state, use the `head:fix/ci-` **search qualifier**, not `--head` — `--head` filters client-side and is ignored by the search API path. `in:head` is silently dropped and falls back to default-field text matching.

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 claim that --head filters client-side / is ignored by the search-API path is empirically incorrect. Running GH_DEBUG=api gh pr list --state closed --author tend-agent --head fix/ci- shows gh translates the flag to head:fix/ci- in the GraphQL search query (q: "author:tend-agent head:fix/ci- repo:max-sixty/tend state:closed type:pr") and returns the same row count as --search "head:fix/ci-". So --head works fine for closed state.

The genuinely useful gotcha (and the one #360 raised) is in:head vs head: — keep that, drop the inaccurate --head framing:

Suggested change
- For closed-state, use the `head:fix/ci-` **search qualifier**, not `--head` — `--head` filters client-side and is ignored by the search API path. `in:head` is silently dropped and falls back to default-field text matching.
- Use the `head:fix/ci-` **search qualifier** (or `--head fix/ci-` — gh translates it to the same query). Don't use `in:head` — that's silently dropped and falls back to default-field text matching.

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.

Verified and applied in 60d8417. GH_DEBUG=api confirms --head fix/ci- becomes q: "... head:fix/ci- ..." in the GraphQL search query — same row count as --search "head:fix/ci-". Reworded the gotcha to keep the real in:head trap and drop the inaccurate --head framing.

Verified with GH_DEBUG=api: gh pr list --head fix/ci- emits
q: "... head:fix/ci- ..." in the GraphQL search query. The genuine
gotcha is in:head silently falling back to default-field text matching.
@max-sixty
max-sixty merged commit 16084d9 into main May 2, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the fix/issue-360 branch May 2, 2026 07:50
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.

ci-fix: also dedup against recently closed fix/ci-* PRs

2 participants