Skip to content

Commit a57b962

Browse files
authored
Merge pull request #2743 from lidge-jun/codex/pin-ci-fetch-tags
test(ci): pin fetch-tags on the jobs that run the suite
2 parents ca3b379 + b8ad97a commit a57b962

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@ jobs:
609609
# between jobs, so leaving a usable token in .git/config is avoidable
610610
# residue. Matches the convention already used by the other workflows.
611611
persist-credentials: false
612+
# Same reason as the Linux shards and the macOS control: this leg runs the
613+
# whole suite, and tests/release-version-line.test.ts reads release tags.
614+
# Without tags the check sees an empty set and cannot fail.
615+
fetch-tags: true
612616

613617
- name: Setup project Bun
614618
uses: ./.github/actions/setup-project-bun

‎devlog/_plan/260827_dev_hardening/020_wp3_failover_identity.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,42 @@ area asserts on source text, which cannot catch a rotation site that forgets a s
6767
2. HTTP 429 rotation: assert `replayOAuthCredentialSnapshot` names the rotated account.
6868
3. Cursor sidecar 429: assert `_cursorConversationId` does not survive the rotation.
6969

70+
## Independent verification (2026-08-27)
71+
72+
A second read-only audit checked every claim above against `dev` rather than trusting
73+
the first pass. Two things changed.
74+
75+
**Confirmed.** The stale snapshot is real: `applyFailoverSnapshot` never updates
76+
`sentOAuthSnapshot`, and `forceRefreshOAuthAccessSnapshot` refreshes the SNAPSHOT's
77+
account (`src/oauth/index.ts:500`), which after a rotation is still A. The
78+
three-site asymmetry is real too, exactly as tabled above. Generic 429 failover never
79+
promotes the active account, so the active-credential helper still names A.
80+
81+
**Corrected.** The 429-then-401 cross-origin send is NOT reachable on today's control
82+
flow, so the table above overstated the consequence. Copilot Responses models take an
83+
early passthrough return that has no generic 429 rotator at all, and in the HTTP
84+
recovery loop the 401 handler sits ABOVE the 429 rotator while the 429 branch does not
85+
`continue recovery` - so a 401 after rotation falls out of the loop and is returned as
86+
an upstream error rather than re-entering the refresh. The runTurn and sidecar paths
87+
never re-enter those 401 blocks either.
88+
89+
That reframes the phase without weakening it. What exists today is latent identity
90+
drift; the missing `continue recovery` is an ACCIDENTAL guard, not a designed one.
91+
Adding that continue - a plausible future improvement to 429 recovery - would activate
92+
the defect. So the fix order matters: rebind identity inside `applyFailoverSnapshot`
93+
FIRST, and only then consider making 429 recovery continue.
94+
95+
The audit also named the specific pairing that would leak if the 401 handler did run:
96+
not the allowlist itself, but the transport fallback that drops to `provider.baseUrl`
97+
when the refreshed account carries no allowlisted origin of its own. After a rotation
98+
that base URL is B's.
99+
100+
Test placement, from the same audit: `tests/generic-oauth-failover.test.ts` already
101+
source-asserts the three `applyFailoverSnapshot` sites, and there is no Copilot
102+
429-then-401 coverage anywhere. The behavioral cases belong beside
103+
`tests/adapter-event-oauth-failover.test.ts` and
104+
`tests/server-xai-oauth-401-replay.test.ts`.
105+
70106
## Boundary
71107

72108
This is an authentication/credential surface. `MAINTAINERS.md` requires explicit

‎tests/ci-workflows.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,20 @@ describe("GitHub Actions hardening", () => {
152152
expect(linuxShards).toEqual([1, 2, 3, 4]);
153153
expect(workflow).toContain(`--shard=\${{ matrix.shard }}/${linuxShards.length}`);
154154

155+
// Every job that runs tests/ must fetch tags, because one of those tests reads
156+
// them. tests/release-version-line.test.ts compares package.json against the
157+
// newest release tag, and actions/checkout brings no tags by default: git is
158+
// present, `git tag --list` exits 0, and stdout is empty. The check then has an
159+
// empty set, cannot fail, and a version regression rides through green. That is
160+
// how the first cut of that test shipped, so pin the flag rather than trusting a
161+
// comment. Asserted per job so a future edit cannot drop it from one leg while
162+
// the other still carries it.
163+
for (const jobName of ["test", "platform-macos", "platform-windows"]) {
164+
const steps = (ci.jobs?.[jobName] as { steps?: Array<{ uses?: string; with?: Record<string, unknown> }> })?.steps ?? [];
165+
const checkout = steps.find(step => typeof step.uses === "string" && step.uses.includes("actions/checkout"));
166+
expect(`${jobName}:${String(checkout?.with?.["fetch-tags"])}`).toBe(`${jobName}:true`);
167+
}
168+
155169
// Windows uses the same shard matrix after the single-leg isolate budget was
156170
// replaced. Keep the two matrices equal so a future edit cannot reintroduce
157171
// a partial Windows suite while Linux stays fully tiled.

0 commit comments

Comments
 (0)