Repository navigation
fix(scripts): prevent gateway benchmarks from stalling on probes - #119063
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 4:12 AM ET / 08:12 UTC. ClawSweeper reviewWhat this changesThe PR makes Gateway benchmark probes use HEAD status responses and wall-clock deadlines, and bounds concurrency benchmark HTTP reads so trickled responses cannot stall a run. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for the protected maintainer landing decision. The exact head repairs a current benchmark-only timeout/body-drain defect with no actionable review finding; its base should be refreshed against current main before normal landing. Priority: P2 Review scores
Verification
How this fits togetherGateway benchmark scripts start or restart a local Gateway and poll its health/readiness endpoints before collecting timing samples. Probe status and bounded HTTP reads determine whether each benchmark phase advances or fails within its budget. flowchart LR
A[Benchmark scripts] --> B[Probe and sample requests]
B --> C[Shared probe helper]
C --> D[Gateway health and readiness endpoints]
D --> E[Status and wall-clock deadline]
E --> F[Benchmark timing result]
B --> G[Concurrency response reader]
G --> E
Decision needed
Why: The PR carries the protected maintainer label and current main has advanced since the recorded integration proof, so a maintainer must make the final landing decision. Before merge
Agent review detailsSecurityNone. PR surfaceTests +206, Other +34. Total +240 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared-helper and concurrency lifecycle repair after current-base merge verification, preserving HEAD status probing and bounded GET body reads as the two distinct benchmark contracts. Do we have a high-confidence way to reproduce the issue? Yes in source: current main waits for a GET response body and uses a socket-idle timeout, while the Gateway already exposes equivalent HEAD status responses; the added exact-head tests model the stalling paths, though this read-only review did not execute them. Is this the best way to solve the issue? Yes. Repairing the shared probe helper and the common concurrency HTTP lifecycle is preferable to changing Gateway endpoints or relying on request socket timeouts, because the endpoint already supports HEAD and the callers that require bodies retain GET. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b1f2aae3034f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
02370cd to
cb312e3
Compare
|
Draft workflow step complete; please refresh the exact-head readiness verdict after the normal merge gates run. @clawsweeper re-review |
|
@clawsweeper re-review Exact head
|
|
🦞🧹 Reason: re-review requires an open issue or PR. |
|
@clawsweeper re-review The remaining exact-head merge gates are complete for
Please refresh the durable checklist against this exact head. |
|
@clawsweeper re-review Exact head: The remaining stale-base and maintainer-handling items are resolved:
Please refresh the durable |
|
@clawsweeper re-review Exact head Please refresh the durable |
|
Merged via squash.
|
|
@clawsweeper re-review Post-landing verification for merge commit
This supplies the exact-current-main verification that was still listed before merge. |
…checkpoint * origin/main: (46 commits) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) fix(scripts): prevent gateway benchmarks from stalling on probes (#119063) test(channels): verify built sanitizer semantics (#119151) fix: prevent live updater from leaving Gateway offline indefinitely (#119116) test(qa): restore memory tools primary ownership (#119142) fix(agents): settle yielded fanout at harness boundary (#118703) fix(codex): cap compaction override warning cache via createDedupeCache (#101745) fix(daemon): skip unlabeled launchd plists (#119091) test(qa): repair QA catalog integrity (#119140) ...
…nclaw#119063) * fix(scripts): bound gateway benchmark probes * fix(scripts): bound concurrency response deadlines * fix(perf): preserve benchmark socket reuse
What Problem This Solves
Fixes an issue where developers running the Gateway startup, restart, or concurrency benchmarks could see healthy probes time out or benchmark phases overrun their intended deadline when response bodies stalled or response headers kept trickling.
Why This Change Was Made
Gateway benchmark probes now use the probe endpoints' existing
HEADcontract and settle from the response status without waiting for a body. Each attempt also has an explicit 100 ms wall-clock deadline, with one settlement guard covering response, timeout, and socket-error races. Normal response completion clears the deadline and preserves the reusable socket; timeout and failure paths destroy the request.This changes benchmark tooling only. Gateway runtime behavior, probe endpoint semantics, and product configuration are unchanged.
User Impact
Gateway benchmarks now measure readiness from the status line and keep every probe attempt within its intended budget, including under partial or continuously active HTTP responses.
Evidence
bed8e7061ed6812a7abdea0728d75f57cc8fd2c8.test/scripts/bench-gateway-startup.test.tstest/scripts/bench-gateway-restart.test.tstest/scripts/bench-gateway-concurrency.test.tssrc/gateway/server-http.probe.test.tsHEAD;oxfmt --check: passed.oxlint: passed.git diff --check: passed.403 admin_required; trusted-source focused local proof was used as the documented fallback.Repair Boundary
endeven though readiness is decided by the status line.requestStatus()transport helper and the concurrency sampler's request lifecycle.HEADcontract, enforce absolute attempt deadlines, resolve successful responses without destroying their sockets, and reserve request destruction for failed or timed-out attempts.