Skip to content

fix(provider): fail a timed-out credential load at once instead of restarting the request - #189

Merged
lg2m merged 3 commits into
perf/eng-791-credential-plan-compilefrom
fix/eng-791-feedback-attribution-stack
Sep 28, 2026
Merged

lg2m merged 3 commits into
perf/eng-791-credential-plan-compilefrom
fix/eng-791-feedback-attribution-stack

Conversation

@integrate-your-mind

@integrate-your-mind integrate-your-mind commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

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 to ProviderErrorKind::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 in docs/design/providers.md beside the retry-ownership paragraph and in the run-reliability ledger.

Review round

Codex was right about one thing: CredentialsUnavailable reads 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-kind ResponseFailed. 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 fails ProviderAuthentication, 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-support green.

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). Only 53dad75 is kept here (with -x), rebased onto main. 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.

@lg2m
lg2m added this pull request to stack #190 September 25, 2026 21:03
@integrate-your-mind integrate-your-mind changed the title fix(runtime): distinguish JEV verdicts from QQ policy fix(runtime): bind run-state admission and clarify JEV feedback Sep 26, 2026
@lg2m
lg2m force-pushed the fix/eng-791-feedback-attribution-stack branch from 0c3ac8c to 794042e Compare September 28, 2026 18:40
@lg2m lg2m changed the title fix(runtime): bind run-state admission and clarify JEV feedback fix(provider): fail a timed-out credential load at once instead of restarting the request Sep 28, 2026
@lg2m
lg2m removed this pull request from stack #190 September 28, 2026 18:52
@lg2m
lg2m force-pushed the fix/eng-791-feedback-attribution-stack branch from 794042e to 01fdfc5 Compare September 28, 2026 18:53
@lg2m
lg2m changed the base branch from feat/eng-791-strict-verification to perf/eng-791-credential-plan-compile September 28, 2026 18:54
@lg2m
lg2m added this pull request to stack #209 September 28, 2026 18:54
@lg2m
lg2m marked this pull request as ready for review September 28, 2026 19:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T19:41:52.222763Z 1aa7f75 New commits
ℹ️ 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" or "@codex security review".

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)
@lg2m
lg2m force-pushed the fix/eng-791-feedback-attribution-stack branch from 01fdfc5 to acd9dab Compare September 28, 2026 19:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/qq-provider/src/request_auth.rs Resolved
Comment thread docs/plans/progress/run-reliability.md Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread docs/plans/progress/run-reliability.md Resolved
…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
@lg2m
lg2m merged commit 7885f2c into main Sep 28, 2026
8 checks passed
@lg2m
lg2m deleted the fix/eng-791-feedback-attribution-stack branch September 28, 2026 20:38
lg2m added a commit that referenced this pull request Sep 29, 2026
- 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
lg2m added a commit that referenced this pull request Sep 29, 2026
…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
lg2m added a commit that referenced this pull request Sep 29, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants