Repository navigation
fix(perf): retry stress setup while Gateway sidecars start - #194563
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds bounded, opt-in retries for startup-sidecar refusals on the first synthetic session creation. Example: The first sessions.create receives UNAVAILABLE with reason startup-sidecars and retryAfterMs 500.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a concrete stress-setup failure that remains on main. No introduced correctness or security bug was found; the required test-line CI gate remains red. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe stress driver uses a shared script WebSocket client to create synthetic sessions before warmup; Gateway responses determine whether setup continues or fails. flowchart LR
A[Stress controller] --> B[Setup RPC]
B --> C[Script WebSocket client]
C --> D[Gateway admission]
D --> E[Startup refusal]
E --> C
D --> F[Session creation]
F --> G[Warmup and measurement]
Technical reviewBest possible solution: Keep the bounded retry in the existing client and handle inherited test-line debt separately. Do we have a high-confidence way to reproduce the issue? Source establishes the failure path: the Gateway emits a retryable pre-admission refusal, the base client returns it immediately, and the stress RPC wrapper throws; this review did not execute target code. Is this the best way to solve the issue? The patch is a small, coherent repair: one existing client owns retry scheduling, one setup call opts in, and the shared deadline prevents retries from extending indefinitely. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d02defd90c72. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +78, Docs +6, Other +52. Total +136 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 7, 2026, 4:31 AM ET / 09:31 UTC. |
|
ClawSweeper status: applying reviewed decision. I am applying the reviewed decision for this pull request: fix(perf): retry stress setup while Gateway sidecars start This is item 1/1 in the current shard. Shard 1/1. This transient lease prevents a newer review from overlapping label, comment, or close mutations. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
What Problem This Solves
Fixes canonical Team-shaped stress setup aborting when
/readyzpasses before Gateway startup sidecars admit the firstsessions.createrequest.User Impact
Benchmark operators can finish setup through this temporary refusal. There is no Gateway runtime behavior change. The first setup request gets a maximum 120-second total budget; transport errors, unrelated refusals, and measured RPC failures still fail immediately.
Why This Change Was Made
The Gateway explicitly reports a pre-admission
UNAVAILABLEerror withretryable: true,details.reason: "startup-sidecars", andretryAfterMs. The existing script WebSocket client now supports an opt-in retry for exactly that response, honoring the delay within one request-and-wait deadline and logging every wait. Only the first synthetic session creation opts in, before warmup or measurement.The existing client owns the retry; there is no new module, product configuration, schema, or production runtime code. Added tooling is necessary to respect the existing startup response contract.
Evidence
10bbb1ed21821aac4ab7409a5be75699a02fd671: the request settles immediately with the startup refusal instead of waiting. It fails on behavior, not imports, type arity, or fixture setup.pnpm tsgo:test:root: all four strict root shards pass, including scripts and tooling. Changed-file format, lint, andgit diff --checkpass.10bbb1ed21821aac4ab7409a5be75699a02fd671→bf33a13ead512afb903ca191dfece9b6accd2bef. The exact branch command waspython3 ~/.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --engine codex, withAUTOREVIEW_*/CODEX_*environment overrides removed.The observed canonical setup failure is reproduced at the actual WebSocket request boundary. A new full Gateway stress campaign has not yet run with this tooling fix; this PR makes no performance or shutdown-latency claim.
CI on exact head
bf33a13ead512afb903ca191dfece9b6accd2befcompleted with one inherited baseline-ratchet failure (and its aggregate gate); the other concrete checks passed. Run 42359026079 tested merge0b1005ff54f580e3decbc16ddfa09b17c0eb0e0c, whose parents are main87c57b41c5906fc25205aaf18363d37750f07b2aand this PR head. Its only changes from that main parent are these five PR files, including exactly 78 new test lines and 78 lines of allocated credit. The ratchet reports 6,560,791 test lines against a 6,560,781 ceiling; subtracting this PR's 78 from each proves the unchanged main parent already had a 10-line deficit (6,560,713 against 6,560,703). The main CI run is green but skips this ratchet, so it is not cited as a direct ratchet pass. No unrelated allocation, CI rerun, or runtime change was added to chase green.