fix(gateway): disable provider auth prewarm by default#86564
fix(gateway): disable provider auth prewarm by default#86564wesleysimplicio wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 3:13 PM ET / 19:13 UTC. Summary PR surface: Source +4, Tests +53. Total +57 across 2 files. Reproducibility: yes. for the central startup-scheduling defect by source inspection: current main and v2026.6.10 pass providerAuthPrewarm without enabled and schedule the delayed warm sweep by default. I did not run a live CPU or latency reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Consolidate on one refreshed hook-only/default-off provider-auth startup branch, preserve explicit enabled coverage and failure-triggered rewarm, and track broader startup latency symptoms separately. Do we have a high-confidence way to reproduce the issue? Yes for the central startup-scheduling defect by source inspection: current main and v2026.6.10 pass providerAuthPrewarm without enabled and schedule the delayed warm sweep by default. I did not run a live CPU or latency reproduction in this read-only review. Is this the best way to solve the issue? Yes if maintainers accept the compatibility tradeoff: the PR targets the scheduler that creates the default warm, preserves explicit startup warming and auth-profile failure rewarm, and adds focused coverage. It still needs canonical branch selection and refresh before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eac1d3349c29. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +53. Total +57 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Thanks for the PR. Before this can move forward, please add live proof from the affected surface, not just unit tests, mocked tests, or source inspection. A useful proof update should include:
Please redact secrets, tokens, phone numbers, and private message content from logs or screenshots. |
|
Live proof from the built tree (SHA 017c0c7, Command: Observed runtime result:
This is the real runtime execution requested for the provider-auth startup path. |
017c0c7 to
187cf1f
Compare
|
Maintainer update: I rebased and narrowed this PR so the default path skips only the startup provider-auth warm. The auth-profile failure hook and delayed rewarm sidecar stay installed, which addresses the ClawSweeper blocker about dropping stale-auth invalidation. Verification:
Windows / WSL proof gap:
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Summary
providerAuthPrewarm.enabled === true.providerAuthPrewarm, so auth-profile failures still clear stale prepared state and schedule a delayed rewarm.Root Cause
The post-attach startup flow treated
providerAuthPrewarmas enabled unless callers explicitly setenabled: false. The normal gateway caller suppliesproviderAuthPrewarmfor live config access, so startup still scheduled provider-auth warm work by default. The previous PR version fixed the startup warm by disabling the entire sidecar, which also removed auth-profile failure invalidation.Fix
enabled: trueas the explicit startup-warm opt-in.enabledas hook-only: register the auth failure hook and rewarm sidecar, but do not schedule startup warm.enabled: falseas the test/minimal disable path.Real behavior proof
Behavior addressed: gateway startup no longer kicks off provider-auth warm by default, while auth-profile failures still clear and rewarm prepared provider-auth state.
Real environment tested: AWS Crabbox Linux runner, lease
cbx_7966d6c753d7, runrun_5d2dd60d1672.Exact steps or command run after this patch:
node scripts/crabbox-wrapper.mjs run --provider aws --label wsl-event-loop-86752-check-changed --idle-timeout 45m --ttl 90m --timing-json --stop-after always --shell -- 'pnpm check:changed'.Evidence after fix:
pnpm check:changedexited 0. The changed gate selectedcoreandcoreTests, then ran conflict-marker guard, dependency guards, core typecheck, core test typecheck, changed-file lint, runtime sidecar loader guard, import-cycle check, webhook body guard, and pairing guards.Observed result after fix: the focused regression path keeps the provider-auth failure hook active without calling
warmCurrentProviderAuthStateOffMainThreadon startup; triggering the auth failure hook clears current provider-auth state and performs the delayed rewarm.What was not tested: native Windows and WSL2 project tests did not run. AWS native Windows had no
noderuntime in PATH (run_a044f871e2b3), the tooling probe also found nonode,choco,winget, orpwsh(run_498feccc91fb), AWS WSL2 hydration exited before its marker (run_9230eb79e292), and Azure WSL2 allocation did not produce a lease after more than 10 minutes (run_6a3979ab4680).Verification
node scripts/run-vitest.mjs src/gateway/server-startup-post-attach.test.tsat187cf1f85e4: 46 passedgit diff --check origin/main...HEADnode scripts/run-oxlint.mjs src/gateway/server-startup-post-attach.ts src/gateway/server-startup-post-attach.test.tsautoreview --mode local: clean, no accepted/actionable findingsrun_5d2dd60d1672, leasecbx_7966d6c753d7,pnpm check:changed, exit 0Related PRs / issues
Fixes #86512
Refs #86752