Repository navigation
perf(runtime): keep credential reads out of plan compilation - #208
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5a7013ebd
ℹ️ 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".
(cherry picked from commit 927ab0b)
(cherry picked from commit b0ae622)
(cherry picked from commit 2415d79)
Adds a regression test that a compile with twelve stored-credential providers reads the secure store once (main read it thirteen times) and an ignored benchmark that times cold compiles behind a 5 ms-per-read keyring for 1/4/16 providers. Records the before/after in the speed-first ledger and corrects the architecture text: one read remains, the selected provider's own credential. Linear: ENG-791
e5a7013 to
994d5d0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 994d5d067a
ℹ️ 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".
…ndly The first cut stopped probing credentials by admitting every configured provider, which advertised every built-in catalog to spawn_agent (64 routes on a default config against 17), let unauthenticated providers crowd the bounded list, bypassed the isolated QA profile's single-route guard, and left Jev routing candidates probing every provider through configured_model_options. model_options_for_plan now admits a provider when its credential is present (index name from one index load, environment variable, inline value, NoAuth, AWS source) without reading the secret, returns the fixture route alone in isolated QA, and is used for routing candidates too. configured_model_options remains for tests only. Architecture text narrowed to the provider path and names the MCP bearer resolution on a registry-cache miss. Tests: plan_spawn_routes_offer_only_providers_with_a_credential_present; isolated_tui_qa_policy_survives_runtime_callbacks_and_reconnect now asserts the plan's single spawn route. Linear: ENG-791
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0687796f9
ℹ️ 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".
Stack #209, 2 of 3: #207 → #208 (this) → #189. Diff shown is this layer only.
What changes for users
Faster time to first token on machines with several configured providers and a secure keyring, especially macOS.
RuntimeFactory::loadbuilt thespawn_agentroute list throughconfigured_model_options, which callsprovider_authenticated(a keyring read) for every configured provider on every plan compile;ModelDiscovery::cachedadditionally resolved a credential just to derive a cache key. Each compile cost N+1 secure-store reads; on macOS each is asecuritydround trip.Now:
spawn_agentroute list and Jev routing candidates admit a provider when its credential is present (a name in the credential index from one index load, a set environment variable, an inline value,NoAuth, an AWS source) without reading the secret. A present-but-unusable credential fails at the child's own load, where the router already falls back to the configured model. Isolated TUI QA offers only its fixture route. Model catalogs shown to a client (/models) still resolve each credential.Measured
cargo test -p qq --release -- --ignored plan_compile_with_slow_keyring --nocapture, 5 ms per keyring read, cold compile median over 50 iterations:Review round
Codex found a real regression in the first cut: dropping the check entirely advertised every built-in catalog (64 routes against 17 on a default config), bypassed the isolated QA single-route guard, and left routing candidates probing every provider. Fixed in
fix(runtime): admit plan spawn routes on credential presencewith regression tests; the MCP doc qualification was also taken. Timings unchanged (5.2 / 5.3 / 5.5 ms).Design
Extracted from #189 (
927ab0b,b0ae622,2415d79, kept with-xand rebased onto main without that stack's admission/--state-rootmachinery). No protocol, schema, config, or Jev change; no new dependency.Verification
plan_compilation_reads_only_the_selected_providers_credential(12 providers, exactly 1 keyring read; main: 13) andplan_spawn_routes_offer_only_providers_with_a_credential_present; isolated-QA single-route assertion.PanicOnReadKeyringtests (codex_plan_compilation_keeps_credentials_request_time,codex_plan_with_no_live_cache_uses_configured_effort_ladder) and thecache_only_discoveryread-count test.cargo fmt --check,cargo clippy --workspace --all-targets --all-features -D warnings,cargo test -p qqgreen.docs/design/architecture.mdcredential paragraph anddocs/plans/progress/speed-first.mdledger entry updated.Linear: ENG-791.