Repository navigation
feat(gateway): track event-loop degradation persistence and add concurrency benchmark - #118193
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 4:54 PM ET / 20:54 UTC. ClawSweeper reviewWhat this changesAdds persistent gateway event-loop degradation duration to diagnostics and operator status surfaces, plus a mock-provider concurrency benchmark wired into the gateway CPU scenario workflow. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain Keep this PR open. The diagnostic and protocol changes are coherent, but the new concurrency benchmark does not honor its configured global timeout for in-flight agent turns, so a short timeout can still wait 60 seconds before cleanup. Priority: P2 Review scores
Verification
How this fits togetherThe gateway measures event-loop delay, utilization, and CPU pressure while serving agent traffic and operator requests. Health snapshots flow into readiness, diagnostics, protocol responses, CLI status, and channel status, while the new benchmark creates concurrent mock streaming turns and probes those surfaces. flowchart LR
A[Concurrent agent turns] --> B[Gateway event-loop monitor]
B --> C[Health snapshot]
C --> D[Readiness and protocol]
C --> E[Diagnostic heartbeat]
D --> F[CLI and channel status]
A --> G[Concurrency benchmark]
G --> D
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +87, Tests +240, Config +1, Other +838. Total +1166 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Thread the absolute benchmark deadline into each concurrent turn, cap both the client RPC wait and the server-side Do we have a high-confidence way to reproduce the issue? Yes, from source: run the benchmark with Is this the best way to solve the issue? No. The proposed benchmark needs one canonical deadline carried through every in-flight operation; limiting only startup and probe waits leaves its public timeout contract false. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b35b8e286df0. LabelsLabel changes:
Label 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
|
|
Rank-up move handling: the deadline-aware |
|
Merged via squash.
|
* origin/main: feat(gateway): track event-loop degradation persistence and add concurrency benchmark (#118193) fix(config): preserve secret ownership when configuration rows move (#118149) fix(cron): deliver failure alerts after persistence (#118200) chore(lint): clear 172 lint:all baseline violations in five batches (#118098) perf(gateway): remove streaming hot-path rescans (#118192) test(gateway): use in-memory task registry (#118191) test(macos): fix three races in the bounded process suites (#118196) refactor(migrate-hermes): consolidate test fixtures (#118182) test(android): share Wear transport fixtures (#118177) test(ui): deduplicate control UI e2e setup (#118180) fix(plugins): unblock prerelease validation (#118103) test(cli): reduce redundant process launches (#118141) test(gateway): compact terminal observer fixtures (#118179) fix(agents): make requested threads sidebar-visible (#118073) test(plugins): canonicalize native resolver fixtures (#118174) test: deduplicate agent runner fixtures (#118176) refactor(policy): consolidate doctor test fixtures (#118173) fix(plugins): remove disabled channel plugin configuration on uninstall (#118127) refactor(matrix): consolidate monitor test fixtures (#118175)
…rrency benchmark (openclaw#118193) * feat(gateway): persist event loop degradation metrics * fix(gateway): bound concurrency benchmark turn waits
* origin/main: feat(gateway): track event-loop degradation persistence and add concurrency benchmark (openclaw#118193) fix(config): preserve secret ownership when configuration rows move (openclaw#118149) fix(cron): deliver failure alerts after persistence (openclaw#118200) chore(lint): clear 172 lint:all baseline violations in five batches (openclaw#118098) perf(gateway): remove streaming hot-path rescans (openclaw#118192) test(gateway): use in-memory task registry (openclaw#118191) test(macos): fix three races in the bounded process suites (openclaw#118196) refactor(migrate-hermes): consolidate test fixtures (openclaw#118182) test(android): share Wear transport fixtures (openclaw#118177) test(ui): deduplicate control UI e2e setup (openclaw#118180) fix(plugins): unblock prerelease validation (openclaw#118103) test(cli): reduce redundant process launches (openclaw#118141) test(gateway): compact terminal observer fixtures (openclaw#118179) fix(agents): make requested threads sidebar-visible (openclaw#118073) test(plugins): canonicalize native resolver fixtures (openclaw#118174) test: deduplicate agent runner fixtures (openclaw#118176) refactor(policy): consolidate doctor test fixtures (openclaw#118173) fix(plugins): remove disabled channel plugin configuration on uninstall (openclaw#118127) refactor(matrix): consolidate monitor test fixtures (openclaw#118175)
What Problem This Solves
Issue #118027 identified that the gateway's event-loop health monitor is pull-only and report-only: nothing tracks whether degradation persists, nothing alerts, and no checked-in benchmark measures gateway behavior under concurrent streaming load (the CPU scenario harness pins qa suite to --concurrency 1, so the concurrency dimension was unmeasured).
Why This Change Was Made
createGatewayEventLoopHealthMonitornow tracksdegradedSinceMson a monotonic clock (also fixing the prior wall-clockDate.nowinterval basis) and exposes apersistentDegradationSnapshot()pull for the heartbeat owner.server-startup-bootstrapto gateway lifecycle ownership and samples persistent degradation (>60 s) through the existingdiagnostic.liveness.warningmachinery with its 120 s cooldown; no second perf monitor, no new timer loop. Readiness/503 semantics are unchanged: degraded never flips/readyz.degradedSinceMsflows additively through the gateway protocol snapshot schema,/readyzdetails,openclaw health,openclaw status, and channel status WARN rows.scripts/bench-gateway-concurrency.tsboots an isolated ephemeral gateway (own state dir + free port), drives N concurrent mock-provider streaming turns, and samples /readyz event-loop metrics, sessions.list RPC latency, and Control UI static asset latency (p50/p95/p99/max). Registered incheck-gateway-cpu-scenarios.mjsand package script, with unit tests over the summary math.User Impact
Operators get a recorded fact ("event loop degraded for 3m") in status/health surfaces and diagnostic logs instead of discovering degradation only during live probing; the concurrency ceiling from #118027 becomes a tracked, reproducible number.
Evidence
Part of #118027. Sibling PRs: perf/stream-hot-path-118027, perf/sessions-list-118027.