Skip to content

The bar stops offering Open PR for a branch that has one - #2102

Merged
suleimansh merged 1 commit into
mainfrom
pr-after-run
Oct 14, 2026
Merged

suleimansh merged 1 commit into
mainfrom
pr-after-run

Conversation

@suleimansh

Copy link
Copy Markdown
Member

👤 Suleiman

I created this: /test-project-1xat1gr/2026-10-14T18-54-31-998Z

it have: 'Auto adds after each message: "When you finish, if you changed any file, commit your work, push your branch and open its pull request, set to merge on its own once its checks pass."'

it created PR, but it also show banner to 'Open Pr'

🤖 automated · Opus 5, effort high

Why. That Auto sentence is handed to the agent, so the agent opens the pull request itself, with its own tools. Nothing records it on the run, and nothing tells the dashboard's pull request cache — which, while the run was still working, had already answered "this branch has none" and keeps that answer for a minute (cache.ts, ttlMs). So the bar offered Open PR for a branch that already had one, which is the single mistake that bar exists to prevent: pressing it asks the git host to open a second.

His run, by the clock:

18:54:31 run starts; the page begins polling its checkout
~18:54:32 the lookup caches "this branch has no pull request"
18:55:08 the agent opens #6
18:55:16 the run ends
until ~18:55:32 the bar still offers Open PR

The fix. An answer taken before a run ended cannot have seen what the run did on its way out, so it is thrown away rather than trusted. A cached read now says when it was read (Cached.at), and the handoff compares that against the run's own endedAt.

The read that follows is cold, so the first look after a run ends says it does not know yet — and the bar offers nothing, never the wrong thing. The branch is read again a second later, which is the pace a just-ended run is already read at (SETTLING_EVERY_MS, #2097).

Checked against his repo, through the built modules in one process, with the real cache and the real git host:

1st read after the end : prPending (the bar offers nothing)
2nd read, a second on  : PR #7 OPEN

PR #7 was opened by hand to stand in for the agent's publish step, and is closed again.

Nothing is thrown away for a run still going, for an answer never read, or for a record whose end is not a date — each has its own case in the test. pnpm build, pnpm -r typecheck, pnpm -r test green.

🤖 Generated with Claude Code

A run told to publish its own work opens its pull request as it finishes,
with its own tools. Nothing records it, and nothing tells the dashboard's
pull request cache — which, while the run was still working, had answered
"this branch has none" and keeps that answer for a minute. So the bar
offered Open PR for a branch that already had one: the single mistake that
bar exists to prevent.

His run: the page cached "no PR" at 18:54:32, the agent opened #6 at
18:55:08, the run ended at 18:55:16, and the bar went on offering Open PR.

An answer taken before a run ended cannot have seen what the run did on
its way out, so it is thrown away rather than trusted. The read that
follows is cold, so the first look after a run ends says it does not know
yet and the bar offers nothing — never the wrong thing — and the branch is
read again a second later, which is the pace a just-ended run is read at.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@suleimansh
suleimansh merged commit 5ffd1ca into main Oct 14, 2026
6 checks passed
@suleimansh
suleimansh deleted the pr-after-run branch October 14, 2026 19:31
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.

1 participant