Repository navigation
Conversation
Use the original route's credential ownership and observed-main caller check before applying Direct hard-lock fallback. Preserve binding, missing-bearer and disabled-route behavior; document and cover the boundary.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
✅ Deterministic PR hygiene checks passed. |
Move the caller-check factory into core-auth, which owns the credential-domain helpers, and update its request-preparation import. Keep the function body and routing/authentication policy unchanged.
|
Intake/scoped review at The change checks the original Direct caller's credential domain before applying stored-main fallback and rechecks state after the startup-binding wait. Keep foreign/missing bearer, workspace mismatch, trusted substitution and cancellation controls; the documented purpose is not to widen Direct admission. Current functional CI is successful; authentication/destination review remains required. Existing current-head CI was inspected; its success is limited to the jobs actually selected, with skipped platforms retaining no runtime certification. No local suite was run for this branch in this intake. No workflow approval, new scan, live configuration change or merge was performed. Required review/readiness gates remain in force. |
…locks, and scope Direct fallback to the locked main (#7393) * fix(codex): renew opted-in pool credit evidence on the existing sweep * test(codex): assert renewal performs no native-main access * fix(codex): limit Direct hard-lock fallback to the locked account Use the original route's credential ownership and observed-main caller check before applying Direct hard-lock fallback. Preserve binding, missing-bearer and disabled-route behavior; document and cover the boundary. * fix(responses): break hard-lock caller-check import cycle Move the caller-check factory into core-auth, which owns the credential-domain helpers, and update its request-preparation import. Keep the function body and routing/authentication policy unchanged. * fix(codex): revalidate hard-lock fallback targets before request rewriting * fix(codex): clear failure windows when account identities are removed Forget account-scoped failure samples and pinned degradation warnings during deletion and physical main-account replacement. Preserve sibling account windows and cover both lifecycle paths. * fix(codex): fence late failure-window samples by dispatch identity Carry the main dispatch proof and stored Pool credential generation into terminal outcomes. Reject stale success and transient samples after identity or credential replacement, while preserving existing health and probe handling. Cover main identity ABA, same-ID Pool recreation, context reuse, and valid-current controls. * fix(codex): revalidate tagged failure samples after credential replacement Retain each stored Pool sample's dispatch credential generation and filter it against one current store snapshot per insertion or lookup. Reset retired-generation degradation, recovery timers and pin warnings without clearing a replacement on stale arrival. Cover both unlocked-read boundaries, derived state and the 512-sample snapshot bound. * fix(codex): preserve failure windows when credential snapshots fail Distinguish failed reads or parsing from valid absent/empty credential stores. Preserve retained samples and derived failure-window state while evidence is unknown, keeping existing boolean liveness callers compatible. Cover fixture read/parse failures, recovery and empty-store retirement without adding snapshot reuse optimization. * fix(codex): reject non-object credential snapshot shapes Require a non-null, non-array object before normalizing store rows. Preserve failure-window evidence for invalid top-level arrays or scalars while keeping missing files and empty objects valid. Cover six top-level shapes without changing row normalization. * refactor(responses): keep passthrough-dispatch within its line budget * fix(codex): keep a paused main caller out of Pool fallback Carries the paused-main regression from #7290 and the production guard it proves is needed, plus a per-generation credit-renewal pacing test requested at intake. Co-authored-by: Hylouis233 <88263959+Hylouis233@users.noreply.github.com> * fix(codex): recheck a predicted-reset main hard lock with metadata (#7312) A predicted reset now arms the capped WHAM recovery schedule instead of suppressing it, so an early reset redeemed outside opencodex is learned from verified metadata. The schedule never runs past the predicted reset, skips paused and needs-reauth mains, and a predicted reset still never lifts the lock by itself. * test(codex): await the async hard-lock fallback override in #7340 cases #7328 made applyMainHardLockFallbackOverride async for the Direct caller check; the #7340 revalidation cases were written against the synchronous form and asserted on a Promise once both landed. Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com> * fix(codex): recheck Direct hard-lock ownership synchronously before rewriting The async caller check now resolves to a synchronous ownership proof that is evaluated after the last await, so a main identity or bearer change during the policy-binding wait cannot reroute the original caller onto the fallback. Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com> * fix(codex): keep predicted-reset hold rechecks paced across transitions (#7312) Track the first hold per identity/credential separately from the backoff reservation so transient 401/403 retries are not re-armed, arm a hold that appears during token preparation instead of reading immediately, pull the due time in when the predicted reset moves earlier or passes, and keep hold reads at least one base interval apart. * fix(codex): honor a revised reset that elapses between hold sweeps (#7312) Recovery scheduling now reads the latest blocking reset from current evidence even after it has passed, so a reset revised earlier and expired before the next sweep releases the old reservation. It remains scheduling evidence only; admission still requires verified metadata. --------- Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com> Co-authored-by: Epinephrine <luvs01@hanmail.net> Co-authored-by: Hylouis233 <88263959+Hylouis233@users.noreply.github.com> Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
Summary
Verification
Initial caller-identity validation at
eed9ca93cdf5a51bcbc4462179ec2c00ede761eb(Windows/Bun 1.4.3):bun node_modules/typescript/bin/tsc --noEmit,bun scripts/structure-ssot.ts,bun scripts/privacy-scan.ts,bun scripts/file-size-ratchet.ts(repository-wide), andgit diff --check— passed.CI cycle follow-up at
901fdde8c6a309f2ce45fbf1dd607084febb1669(Windows/Bun 1.4.3):mainHardLockFallbackCallerCheckverbatim intocore-auth.ts, which owns its credential-domain helpers, and update the import. This removes the cycle throughcore-options.tsandmain-hard-lock-routing.tswithout changing routing or authentication policy.bun test tests/responses/responses-core-modules.test.ts: 9 pass / 1 fail before the fix, then 10 pass / 0 fail / 414 assertions after it. The focused test through the official wrapper also recorded 10 pass / 414 assertions / exit 0. These are separate runs.The full local repository test suite, unfiltered local changed-test suite and real-provider E2E were not run. The selected five files took 193 seconds on a shared host, so local validation was limited to the changed behavior and directly connected authentication cases. Hosted CI coverage is recorded separately below. No GUI changes.
Current-head hosted CI at
901fdde8c6a309f2ce45fbf1dd607084febb1669: Cross-platform CI 39150023588 completed successfully;test 1/4,test 2/4,test 3/4andtest 4/4each succeeded. Jobs marked skipped remain unexecuted and are not counted as passing platform validation.This PR is ready for maintainer review. Maintainer security review of the authentication boundary and any required Code Owner approval remain pending before merge; local independent review is not that approval.
Checklist
901fdde8c6a309f2ce45fbf1dd607084febb1669.Summary by CodeRabbit