Skip to content

skills: check the default branch for a landed fix before opening a PR - #1070

Merged
max-sixty merged 4 commits into
mainfrom
fix/issue-1068
Aug 28, 2026
Merged

max-sixty merged 4 commits into
mainfrom
fix/issue-1068

Conversation

@tend-agent

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

Copy link
Copy Markdown
Collaborator

A fix can land on the default branch while an agent is preparing a PR. The existing PR-only dedup check cannot see a direct commit, so the agent may publish a PR for a problem that is already fixed.

The final pre-publish check now fetches the default branch and inspects the commits that arrived since the checkout. ci-fix points to that canonical rule while retaining its author-agnostic PR query. If the failure no longer reproduces on the fetched branch, the agent does not open the PR.

Verification: pre-commit on both changed skill files, plus the three duplicate PRs documented in #1068.

Closes #1068

@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 narrowing in the ci-fix edit: step 3's old line said "Re-check for existing fix PRs", which a session naturally satisfies by re-running step 1's gh pr list --state all --limit 30 — author-agnostic, and step 1 explicitly names "a maintainer's in-flight fix under any branch name" as a thing it catches. The section it now delegates to queries --author "$BOT_LOGIN" plus an issue-number search (and ci-fix has no triggering issue), so a maintainer's fix PR opened mid-session is no longer covered by either half of the recheck: not by the PR query (wrong author) and not by the new default-branch check (not landed yet). That's the same duplicate-PR-against-a-competing-fix outcome the change is closing, just via the author filter instead of the PR-vs-commit gap. #1068's proposed wording kept the step 1 re-run explicit ("re-run the step 1 query"); the inline suggestion restores it.

The recipe itself checks out: actions/checkout leaves remote.origin.fetch as +refs/heads/*:refs/remotes/origin/*, so git fetch origin "$DEFAULT_BRANCH" does advance the remote-tracking ref and HEAD..origin/<default> is accurate after the fix branch is committed.

@max-sixty
max-sixty merged commit 1ae7ed5 into main Aug 28, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/issue-1068 branch August 28, 2026 02:18
@tend-agent tend-agent mentioned this pull request Aug 30, 2026
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 30, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.20 → 0.1.22

## Notable changes

- **Notifications now run off a recovery queue** (max-sixty/tend#1074).
The pre-check drops the old layered inbox sweep (shadowed-run and
closed-bot-PR marking) in favour of a single paginated snapshot taken
before a 10-minute cutoff, passes that cutoff through to the agent, and
keeps repository watching enabled with an idempotent `PUT
.../subscription` on every cycle. The job also gains a serial
`tend-notifications` concurrency group.
- **`tend-review` re-targets instead of skipping**
(max-sixty/tend#1082). The "skip when the live HEAD is already examined"
gate step and its `if:` guards are gone; a live session now re-targets
when HEAD moves. The concurrency group adds `queue: max` so a push can't
evict a pending `ready_for_review` run.
- **Skills check the default branch for a landed fix before opening a
PR** (max-sixty/tend#1070), and `review-runs` gains the run census as a
second stranded-trigger drain input (max-sixty/tend#1073).
- **Poll/rerun script fixes** (max-sixty/tend#1053,
max-sixty/tend#1055): `tend-review` no longer gates the CI poll, and an
unresolvable commit fails fast rather than passing silently.
- **Generator fixes**: `watched_workflows` and `branches` are validated
as string lists (max-sixty/tend#1076), and block prompts no longer get
padded blank lines (max-sixty/tend#1090).

Full upstream diff:
max-sixty/tend@0.1.20...0.1.22

Co-authored-by: worktrunk-bot <[email protected]>
max-sixty pushed a commit to max-sixty/leaf that referenced this pull request Aug 30, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.20 → 0.1.22

**Notable changes**

- Notifications recover work missed while the unread queue was stale,
and the job now runs under its own `tend-notifications` concurrency
group so overlapping schedules serialize instead of racing
(max-sixty/tend#1074).
- Skills check the default branch for a landed fix before opening a PR,
cutting duplicate PRs for work that already merged
(max-sixty/tend#1070).
- `review-runs` gains the run census as a second stranded-trigger drain
input (max-sixty/tend#1073), and reviews re-target when HEAD moves
rather than being discarded (max-sixty/tend#1082).
- The CI poll no longer lets `tend-review` gate it, and the
commit-resolution script fails fast instead of proceeding on an
unresolved SHA (max-sixty/tend#1053, max-sixty/tend#1055).
- The generator validates `watched_workflows` and `branches` as string
lists, and stops padding blank lines inside block prompts
(max-sixty/tend#1076, max-sixty/tend#1090).

max-sixty/tend@0.1.20...0.1.22


**Beyond the regeneration:** 0.1.22's `tend-review.yaml` sets
`concurrency.queue: max`, which GitHub accepts but the pinned
`actionlint` hook rejects, so this PR also adds a scoped `-ignore` for
that one schema message to `.pre-commit-config.yaml` — otherwise `lint`
is red and the PR can't merge on its own CI. Tracked upstream as
max-sixty/tend#1094.

---------

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants