Repository navigation
fix(auth): coalesce and bound repeated keychain reads - #299
Conversation
(cherry picked from commit d04bc59)
(cherry picked from commit 0123ac1)
(cherry picked from commit d156465)
(cherry picked from commit 6e1100f)
(cherry picked from commit 484ba1b)
(cherry picked from commit 0dfe4cf)
(cherry picked from commit f842db3)
(cherry picked from commit d223bf0)
(cherry picked from commit 2813717)
(cherry picked from commit e6b0879)
(cherry picked from commit ba84158)
(cherry picked from commit 05c0772)
KP1: retain the prior regular executable before selecting an update; publish read-only payloads and refuse unexpected nodes or hard links. Validate idle migration, rollback, refusal, and recovery with the bounded native-process installer probe.
|
Misa — bounded installer/scope review at c6852fa. The retained installer is substantive, but this PR does not establish the original macOS update/Keychain outcome. Its own live-E2E note reports an update prompt; I have not independently reproduced the Darwin behavior or verified its certificate diagnosis. No trust/signing/security change is authorized by this review. I fetched this head and compared install.sh by Git blob: 393ce7c3a25dd3a3230bec3af872ced824da5199, exactly identical to #287. Therefore the execution-reproduced hard-link publication/retry defect documented in #287 (comment) applies to these same installer bytes. This reuses exact-content evidence rather than rerunning the identical suite or claiming an independent macOS test. Scope needs explicit reconciliation: the merge-base PR diff is 39 files, 6,664 additions and 259 deletions, including auth, runtime, approval and budget changes. It is not installer-only. Those inherited changes need their own requirement/authorship/review mapping; installer approval cannot cover the rest. I have not completed review or execution of all 39 files. Disposition: needs installer recovery fix, full scope mapping, and actual macOS outcome qualification. Preserve Devin and other contributors' provenance. Full Rust execution on my cloud host is blocked by absent Cargo; no merge/deployment/readiness claim. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Takeover complete at 97bc28c. Existing branch and PR retained, targeting main; draft removed. Final diff: 8 files, +1,215/-21. Jev, diagnostics, installer and unrelated stack removed from final diff. Verification receipt: red backend-count regression before fix; 76/76 auth tests; full workspace 2,655/2,655 (15 skipped); minimal provider 211/211; doctests, fmt/lint/strict Clippy all pass; all six binary smoke scenarios pass. Independent static reviewer approved without blocking findings. Hosted build and fmt/lint/clippy/tests/smoke checks now also pass. GitHub reports MERGEABLE. Scope limitation: this is process-local read coalescing and a bounded five-minute successful-read memo, not a claim of persistent macOS Keychain authorization across updates. External keychain changes can remain unobserved within that window. No native macOS credential/ACL trial was performed. No diagnostics PR was necessary. Ready for your review/merge; not merged automatically. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97bc28cd2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cargo xtask checkHead
All gates passed in 349.4s. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Take over and narrow the existing PR to stored-keyring read reuse only. The original 39-file stack is replaced by an 8-file diff against main. No Jev, diagnostics, installer, budget, client/TUI, signing or ACL changes remain. Original branch/history retained; no force-push or replacement PR.
CredentialStore clones now share a coordinator that coalesces cold concurrent reads for the same credential, endpoint context and durable credential epoch. Successful keyring reads are reused for up to five minutes, with at most 64 cached entries and 64 distinct active flights. Registration, endpoint binding and index integrity are checked before reuse. Failures fan out to existing followers but are not negatively cached; unwind/poison handling wakes waiters. File and Windows-protected file reads stay uncached. Codex refresh/deadline paths and xAI rereads under the refresh lock bypass the memo to preserve authoritative rereads. Initial valid xAI OAuth reads use the shared memo.
Scope and tradeoffs
Verification
Red regression committed first at 547b247: repeated resolution across clones read the fake keyring twice, failing
left: 2, right: 1. Narrowed implementation: 77/77 qq-auth tests passed. Coverage includes cold same-key coalescing, independent keys, retryable failure, panic/poison wakeup, capacity recovery/revalidation, epoch/endpoint/index validation, deterministic expiry with external rotation/deletion, uncached file permissions, and existing OAuth freshness/failure regressions.Independent static sub-agent review: Approve, no blocking introduced bug found. Parent inspected implementation and ran checks. Initial workspace run exposed a runtime test assuming every retry reads the backend; updated it to prove cancelled plan is not published even on a warm memo, then prove durable rotation forces both fresh read and compilation.
Final verified code head: 8859c82.
cargo xtask check
Head
8859c820b54evsorigin/main; 0 changed file(s); scope: full workspace.cargo fmt --all -- --checkcargo xtask lintcargo clippy --color never --workspace --all-targets --all-features -- -D warningscargo nextest run --color never --profile default --workspacecargo test --color never --workspace --doccargo clippy --color never -p qq-provider --no-default-features --features test-support --all-targets -- -D warningscargo nextest run --color never --profile default -p qq-provider --no-default-features --features test-supportAll gates passed in 345.4s.
The evidence tool reports 0 changed files for the full-workspace selection; the actual PR diff is 8 files, +1,215/-21 (initial narrowed head; review follow-up adjusts tests and xAI).
cargo xtask smoke: 6/6 passed (ask streaming, durable tool call, provider 401, resume, server SSE, doctor/config).Performance and limitations
Fake-backend counts prove eight concurrent cold resolutions use one backend read, and repeated warm resolutions use no additional read. These are operation-count results, not measured macOS latency. No live macOS Keychain, signed-update, ACL-persistence or real-credential test was run on this Linux host. Diagnostics are deliberately excluded and no new diagnostics PR is necessary for this fix.