Skip to content

A managed refresh retries instead of asking the user when a local commit lands during its publish (GST-3106) - #9744

Merged
capy-ai[bot] merged 9 commits into
masterfrom
capy/gst-3106-refresh-retry
Nov 19, 2026
Merged

capy-ai[bot] merged 9 commits into
masterfrom
capy/gst-3106-refresh-retry

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

A managed refresh that publishes the checkout's local commits no longer stops with an ask-the-user refusal when another local commit lands before it finishes. It retries once in the same run and publishes that commit too.
Why: an unattended refresh started between two door commits ended with exit 1 and a "needs the user" fix, although nothing was lost and the next refresh succeeded by itself.
Nothing to do: no setting, error code or default changes.

What changed

Details

After its own publish, the refresh checks the checkout again with publishing off. A commit made in that window leaves HEAD off the upstream's line, so that check refused refresh_diverged, with a fix that said to ask the user and push by hand. That refusal is now marked for the refresh's existing one-retry-per-run path, but only when it comes after this run's publish and HEAD moved since the run's first check. The retry starts from a fresh check, which publishes the new commit merged with the upstream and then fast-forwards. If the retry is refused too, the original refusal keeps its "already published" sentence and adds the retry's refusal. A diverged checkout that no publish touched still refuses as before.

The completed result's published field describes the retry's publish (the newest local commits), not both publishes.

Why

Details

The new test fails before the fix and passes after it, on PGLite and Postgres. The test in test/refresh-publish-diverged-7686.test.ts diverges the checkout, turns publishing on and makes a second local commit from the publish child right after the publish returns. On master the refresh refuses refresh_diverged with ask_user: true. With the fix it completes, the remote holds both commits and the checkout sits at the remote head. The 7686 publish suite and the 8828 own-commits replan suite pass on both engines (25 of 25), and typecheck is clean.

Also carries one test-only case for #9724, whose landing waived the receipt because no test named src/core/repair/settle.ts: test/dream-patterns-leftover-cap-9708.test.ts now checks on both engines that repairAdmissionWindow equals outstandingAdmissionWindow for caps 8, 1 and 200 (windows 4, 1 and 64).

Blast radius

Details

One condition in src/core/persistence/worktree-refresh.ts, in the post-publish check. No migration, config key, error code, CLI flag or MCP field changes, and nothing under .github/.

Open in Capy

garrytan and others added 2 commits November 18, 2026 20:18
…l commit lands before it finishes

After the refresh publishes the checkout's local commits it checks the
checkout again. A commit made in that window used to end the run with
refresh_diverged and an ask-the-user fix. The refresh now retries once from
a fresh check, which publishes the new commit too.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 18, 2026 21:31
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan and others added 4 commits November 19, 2026 04:42
…that the store failed, and the secret audit logs are 0600

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 19, 2026 06:10
@capy-ai capy-ai Bot added the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 19, 2026
@github-actions github-actions Bot removed the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 19, 2026
@capy-ai
capy-ai Bot merged commit 30f8d29 into master Nov 19, 2026
221 checks passed
garrytan added a commit that referenced this pull request Nov 19, 2026
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	src/core/persistence/worktree-refresh.ts
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
Releases v0.60.744.0 with eight changes since v0.60.743.0, including a security fix: archived sources are now hidden from every API token (#9795).
- Archiving a source now hides its pages from every API token, not just from search (#9795)
- `gbrain sources refresh` no longer stops and asks for the user when a local commit lands while it publishes the checkout's earlier local commits (#9744)
- A managed `gbrain sources refresh` that brings in a few files now holds the checkout's refresh lock for about a second instead of minutes, and reports where its time went (#9746)
- The Mac helper's send log no longer keeps a recipient hash that can be reversed by trying every phone number (#9756)
- The experimental Rust engine's store now serves vector search, embeddings, link and graph reads, takes, salience, stats and the ingest log the way PGLite does, but nothing selects it yet; PGLite and Postgres brains are unchanged (#9759)
- A publish that redacts secrets no longer reports a failure that did not happen, and the secret audit logs are private to their owner (#9790)
- Purging a page now removes the secret store originals only that page held (#9796)
- The bake-off baseline benchmark can run against Postgres on a clean install again (#9758)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: garrytan <garrytan@gmail.com>
@capy-ai
capy-ai Bot deleted the capy/gst-3106-refresh-retry branch November 21, 2026 17:15
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