Repository navigation
fix(provider): fail a timed-out credential load at once instead of restarting the request - #189
Conversation
0c3ac8c to
794042e
Compare
794042e to
01fdfc5
Compare
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. |
ENG-791 request-time credential retry correction. Preserve transient refresh and storage retries; cover provider restart and run-turn boundaries with credential-free tests. (cherry picked from commit 53dad75)
01fdfc5 to
acd9dab
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acd9dab964
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acd9dab964
ℹ️ 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".
…n failure, not a missing credential CredentialsUnavailable means "no credential configured" to the live provider canary (xtask classify_provider_error skips it), so a hung Keychain would have been reported as a skip instead of a failure. The timeout and capacity cases are now ResponseFailed of kind Authentication: still terminal (no restart, no turn retry), but a distinct failure. Linear: ENG-791
- Turning Jev off: profile values beat top-level ones, so require the QQ_JEV_*=off server overrides or clearing the profile's values. - Approval preview: list the fields sent verbatim (workspace, working directory, edit path, recent action paths, grant lists); only the brief, command, diff and arguments are masked; the whole request is capped at 64 KiB. - Design § 4 is the target, not as-built; note that enforce adds a serial wait today. - The 2026-09-25 audit was never on main; point to 0c1cbd6 / refs/pull/193/head. - Ledger: one writer per ledger. Plan status: JV0 in review. - Owner decision 4 no longer refers to #189's feedback fix, which was not merged. Linear: ENG-791
…ification steps - docs/adr/0047-jev-approval-hold-lifecycle.md (Proposed): #193's "0046" decisions 1-7 and the hold-phase table, renumbered and without the #187/#189 framing. Indexed; root.md reservation marked Proposed. - Plan acceptance: the #193 clauses with no counterpart in A1-A13 (grants survive Off, no full transcript, cancel/deadline and final-vs-advisory Deny, priceless fallback under a hard cap, receipt hashes, unknown MCP effects, rollout/backup/no auto-downgrade). - Qualification procedure: run record, zero-connection proof, arm purposes, per-decision fields ("missing cost is not zero"), per-hold counting, and paired statistics. Linear: ENG-791
…book (#210) * docs(jev): consolidate Jev docs into one design, plan, ledger and runbook Opted-in users report that most calls sent to Jev come back to them. The Jev documentation was split across a superseded runtime review, an untracked audit, a shipped opt-in plan and ledger, and an unmerged proposal (#193), so there was no single account of why or what is next. - design/jev.md: what Jev is (vendor claims separated from QQ evidence), the four capabilities as built, eight findings on why work is handed back (re-checked against main 1e91895), and the direction. - plans/jev.md: the only Jev plan, JV0-JV13 with acceptance and the qualification procedure. Folds in #193 (ENG-938). - plans/progress/jev.md: ledger carrying the J1-J9, RR3, DA5 and audit history. - runbooks/jev.md: rewritten operator procedure with current limitations and workarounds. - Delete design/jev-runtime-review-2026-09-18.md, plans/jev-opt-in.md and plans/progress/jev-opt-in.md; update indexes and cross-links; reserve ADR-0047 for the held-approval lifecycle (JV5). Docs only. No Rust, configuration, protocol or schema changes. Refs: ENG-791 * docs(jev): correct the off procedure, approval disclosure and provenance - Turning Jev off: profile values beat top-level ones, so require the QQ_JEV_*=off server overrides or clearing the profile's values. - Approval preview: list the fields sent verbatim (workspace, working directory, edit path, recent action paths, grant lists); only the brief, command, diff and arguments are masked; the whole request is capped at 64 KiB. - Design § 4 is the target, not as-built; note that enforce adds a serial wait today. - The 2026-09-25 audit was never on main; point to 0c1cbd6 / refs/pull/193/head. - Ledger: one writer per ledger. Plan status: JV0 in review. - Owner decision 4 no longer refers to #189's feedback fix, which was not merged. Linear: ENG-791 * docs(jev): carry #193's hold-lifecycle ADR, missing criteria and qualification steps - docs/adr/0047-jev-approval-hold-lifecycle.md (Proposed): #193's "0046" decisions 1-7 and the hold-phase table, renumbered and without the #187/#189 framing. Indexed; root.md reservation marked Proposed. - Plan acceptance: the #193 clauses with no counterpart in A1-A13 (grants survive Off, no full transcript, cancel/deadline and final-vs-advisory Deny, priceless fallback under a hard cap, receipt hashes, unknown MCP effects, rollout/backup/no auto-downgrade). - Qualification procedure: run record, zero-connection proof, arm purposes, per-decision fields ("missing cost is not zero"), per-hold counting, and paired statistics. Linear: ENG-791 * docs(jev): qualify masking, missing-key startup and in-flight approval spend Linear: ENG-791 * docs(jev): say when approval_delegate lets Jev see a held call Linear: ENG-791
Stack #209, 3 of 3: #207 → #208 → #189 (this). Diff shown is this layer only.
What changes for users
When the request-time credential load times out (65 s) or finds the loader at capacity, the request now fails immediately as an authentication failure naming the cause (
ResponseFailed { kind: Authentication }). Previously both were mapped toProviderErrorKind::Unavailable, which the provider restart loop treats as transient: a Keychain that hung once was asked again up to four times, several minutes with no output before the first token.Refresh, storage, and worker failures keep their transient classification and retry, since the next attempt can succeed.
Why / design
crates/qq-provider/src/request_auth.rs::request_credential_error— three lines. The restart loop has already waited the full bound once; resending waits it again. Authentication-class is the honest category: the run stops with the cause instead of stalling. Recorded indocs/design/providers.mdbeside the retry-ownership paragraph and in the run-reliability ledger.Review round
Codex was right about one thing:
CredentialsUnavailablereads as "no credential configured" to the live-provider canary, which skips it, so a hung Keychain would have been hidden. The mapping now uses an authentication-kindResponseFailed. It is still terminal, but the canary reports it as a failure. The ledger-slice comments were declined.Verification
Red on
main, green here:qq-provider:timed_out_and_exhausted_credential_loads_are_terminal_for_this_request;credential_timeout_and_capacity_do_not_restart_before_first_event(one credential call, zero transport sends);temporary_refresh_and_storage_failures_can_restart_before_first_event(retry preserved).qq-core:credential_load_timeout_does_not_retry_the_turn(run failsProviderAuthentication, no turn retry, no pause).cargo fmt --check,cargo clippy --workspace --all-targets --all-features -D warnings,cargo test --workspace,cargo test -p qq-provider --no-default-features --features test-supportgreen.Provenance
This PR was rewritten by the maintainer. It previously carried 17 commits stacked on #187 (Jev feedback attribution,
--state-root, run-state admission, credential-probe removal, Harbor fixes). Only53dad75is kept here (with-x), rebased ontomain. The other real fixes from that stack are extracted separately: Harbor adapter in #207, credential reads out of plan compilation in #208. The admission /--state-root/ feedback-string work is not taken.Linear: ENG-791.