Repository navigation
ci(fork): upstream sync repairs itself in rounds and continues a red sync - #163
Merged
Merged
Conversation
…sync Copilot now gets up to three sessions, each started with the red verify reports of the one before, a wait timeout long enough for verify, and a larger per-session budget. A sync that stays red is continued the next day from its open PR instead of being redone from fork with a bigger backlog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sync now runs on Mondays (04:00 UTC, 06:00 Berlin in summer, 05:00 in winter), so each run can spend more: - 1500 AI credits per Copilot session instead of 600, and sessions of up to 80 minutes instead of 70. - Still 3 rounds per run: a round is up to 80 min of Copilot plus up to 30 min of verify, so three fit into the job's 355 minutes (GitHub-hosted jobs stop at 360). The loop skips a round that would not finish in time. - A red run that Copilot did not mark blocked dispatches the next run, which continues from the draft PR it just opened, up to 3 runs per sync. That gives up to 9 rounds a week without restructuring the job. Worst case is 3 x 3 x 1500 credits = $135 a week, about what 7 daily runs at 3 x 600 could cost before. - Model gpt-6.1-sol (GA in Copilot since 2026-09-29). The org's model list of 16 Oct does not offer it yet, so the run falls back to gpt-5.6-sol with a warning until an admin enables it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd the lost fork lines Lessons from landing #158 by hand: a hand-merged patches/ file broke the install and hid everything after it, vpr typecheck stopped at the first red package, and a lost fork feature drowned in the audit. The prompt now also asks for repo-wide fixes and regenerated generated files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #162.
Problem
The upstream sync keeps ending as red drafts (#146–#149, #157, #158). Since 10 Oct only 2 of 7 scheduled runs merged themselves (#153, #154). The others needed Paul to step in. The sync artifacts show four causes:
Timed out after 600s waiting for background tasks … Set COPILOT_TASK_WAIT_TIMEOUT_SECONDS). The session ends with no summary. This happened on 12, 13, 14 and 15 Oct; chore: merge upstream/main (e536bfd33) #157's "Verification is still running." is this case.Session limits: 278/300 AI credits used). chore: merge upstream/main (cfafb4bb54) #158 stopped half done. It even left a lockfile that doesn't matchcatalogs, which is why itscopilot-setup-stepscheck failed. That is a symptom, not a separate environment problem.fork, so the backlog grows: 38 → 47 → 52 conflicts from 10 to 12 Oct, and 7 → 26 from 15 to 16 Oct. That lasted until someone merged by hand (chore: merge upstream/main (58d253231d) #150 from the…-manualbranch).The failures in #157/#158 were real breakages (CoordinatorUpdates, ThreadDecisions, typecheck), not flaky tests.
Fix
roundssessions (default 3). After each one it commits what's left, including unresolved markers, and runs the fixed verify. While verify is red, the next session starts with checks.md, guards.md, audit.md and the failing lines of checks.log. A session that writesblockedends the loop. The final verify step reuses the last result in the loop and doesn't spend another 25 min.COPILOT_TASK_WAIT_TIMEOUT_SECONDS=3600. The prompt also tells the agent to iterate with targeted typecheck and test runs, and to run the full verify at most once.max_ai_creditsnow applies per session, and the default goes from 300 to 1500. Each session is capped at 80 min, and the job timeout goes from 150 to 355 min (GitHub-hosted jobs stop at 360). That leaves room for 3 rounds per run, each up to 80 min of Copilot plus up to 30 min of verify. The loop doesn't start a round that couldn't finish in time.blockeddispatches the next run (newattemptinput, up toMAX_ATTEMPTS= 3). That run continues from the draft PR the first one just opened. This gives up to 9 rounds a week without splitting the job. In the worst case that's 3 × 3 × 1500 credits = $135 a week, roughly what 7 daily runs at 3 × 600 could have cost before.gpt-6.1-sol, which has been GA in Copilot since 29 Sep. The org's model list from the 16 Oct run doesn't offer it yet. Until an admin enables it, the run falls back toFALLBACK_MODEL(gpt-5.6-sol) with a warning.sync/upstream-*PR.mergethen mergesfork's new commits and upstream into that PR's branch, so its resolutions, its fixes and any fixes pushed by hand carry over, and only conflicts that are new since then come up. Iffork's new commits conflict with that branch, the sync falls back to a fresh merge. Before checking,verifyfolds the history into one merge commit ofFORK_SHAandTARGETwith the same tree, so guards and the PR shape don't change. It folds only when both commits are ancestors of HEAD. Publish closes the PR it continued from with "Continued in …". The newfreshinput turns this off.--retry 1, so a single flaky test doesn't hand the sync to the maintainer. Files that the result takes from neither side also count as touched, so their tests still run after folding.dry_runnow opens no PR and closes none; the result is only in the artifact. Before, it opened a draft, which a later run would have treated as an attempt to continue.vp install(chore: merge upstream/main (cfafb4bb54) #158: a hand-mergedpatches/file with a broken hunk header,ERR_PNPM_PATCH_FAILED) now stops the checks with a bold "fix this first" in checks.md, instead of a list of follow-up failures against the wrong lockfile.vpr typecheckstopped at the first.audit-lines.txt). The round prompt shows them and asks Copilot to account for every file: restore the feature or explain the loss in its summary. chore: merge upstream/main (cfafb4bb54) #158 lost the PR panel's status grouping this way, unnoticed.patches/files against the pristine package instead of hand-merging them, and to regenerate generated files (routeTree.gen.tswith the fork's routes, mobilegenerated-uniwind-themes.css) instead of picking a side.All of this is in fork-only files (
.github/workflows/fork-upstream-sync.yml,.github/scripts/fork-upstream-sync.sh, FORK.md, the changelog).Validation
copilot-requests, which actionlint doesn't know yet.fork's new commits conflict with the earlier attempt, it falls back to a fresh merge.audit-lines.txtran against a throwaway repo with a stubbedvp.mergeruns the scripts fromfork, so a dispatch from this branch can only exercise the rounds and the wait timeout, not continuation.🤖 Generated with Claude Code (Claude Opus 5.5, esveo code)