Repository navigation
fix(gateway): expose missing worker RPC latency diagnostics - #145602
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: needs maintainer review before merge. Reviewed September 12, 2026, 12:12 PM ET / 16:12 UTC (Revision 3). ClawSweeper reviewWhat this changesAdds worker request queue, handler, and response timing to existing Gateway diagnostics, with bounded method labels, regression tests, and documentation. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still lacks dedicated worker RPC timing coverage. The reviewed patch has no actionable correctness or security findings. Priority: P2 Review scores
Verification
How this fits togetherDedicated worker WebSockets carry inference, transcript, and computer requests into the Gateway. The shared diagnostics lifecycle turns request timing and sender outcomes into events consumed by the OpenTelemetry plugin. flowchart LR
A[Worker RPC frame] --> B[Socket FIFO]
B --> C[Frame validation]
C --> D[Worker dispatcher]
D --> E[Response sender]
B --> F[Shared RPC diagnostics]
D --> F
E --> F
F --> G[OpenTelemetry metrics]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +69, Tests +271, Docs +10. Total +350 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep worker timing in the shared RPC diagnostics owner, preserving existing dispatch semantics and documenting the limits of sender-acceptance measurements. Do we have a high-confidence way to reproduce the issue? Yes, from source: admitted worker requests bypass the generic dispatcher and its diagnostics on current main. Runtime reproduction was not executed in this read-only review. Is this the best way to solve the issue? Yes. Instrumenting the dedicated ingress through the existing lifecycle is a focused repair that preserves the closed worker dispatcher and existing exporter contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5ba72cc78e39. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
3b599b2 to
d34c45b
Compare
|
Merged via squash.
|
Restore Gateway test typecheck headroom by moving the complete nested server test subtree into the existing gateway-server compiler graph. Matching include/exclude patterns preserve exact root coverage, compiler concurrency, and the 700-root headroom guard and 720-root hard cap. Update the CI ownership documentation. The existing inventory regression failed before at 701 gateway-other roots and passed all 24 tests afterward. Both affected compiler graphs and changed-file checks passed. Hosted CI run 34706250754 is green on ce1965c, reconfirmed by the exact-head watcher. No runtime behavior changes. Refs #145602, #145461, #145431.
Restore Gateway test typecheck headroom by moving the complete nested server test subtree into the existing gateway-server compiler graph. Matching include/exclude patterns preserve exact root coverage, compiler concurrency, and the 700-root headroom guard and 720-root hard cap. Update the CI ownership documentation. The existing inventory regression failed before at 701 gateway-other roots and passed all 24 tests afterward. Both affected compiler graphs and changed-file checks passed. Hosted CI run 34706250754 is green on ce1965c, reconfirmed by the exact-head watcher. No runtime behavior changes. Refs openclaw#145602, openclaw#145461, openclaw#145431.
Closes #145587
Follows merged #145600. This main-targeted PR contains only worker RPC diagnostic coverage.
What Problem This Solves
Resolves a problem where operators investigating cloud-worker pauses cannot distinguish Gateway queue wait, request handling, and response delay because dedicated worker ingress bypasses Gateway RPC diagnostics.
Why This Change Was Made
Reuse the existing
gateway.rpclifecycle at the dedicated worker ingress boundary. Capture receipt before its FIFO, preserve the dequeue time through validation, and record handler settlement and the actual sender result. Method dimensions come from the canonical closed worker method tuples; unknown methods use one fixed label.Existing scheduling, inference acknowledgment ordering, durable transcript commits, and connection ownership stay intact. Production delta: +69 lines to cover the previously unobserved ingress boundary; tests: +271; docs: +10. No new metric names, configuration, protocol fields, or storage are introduced.
User Impact
Existing Gateway RPC dashboards can distinguish worker FIFO admission, handler work, and response sending. A successful send records acceptance by the WebSocket sender; client receipt is outside this measurement. Timing starts at the JavaScript socket callback. It excludes preceding network/event-loop delay; inference-start measures acceptance/setup rather than provider completion. Socket closure alone does not prove execution cancellation. This enables diagnosis and makes no measured latency-reduction claim.
Evidence
Development proof at the original telemetry head
3b599b2eca3d3e1f450d5ae79ea05bcd97730329used Node 24.19.0 on Blacksmith Testbox, with all 41,132 source blobs and the frozen dependency lock verified. Testbox hydration run.The signed restack
d34c45bf00da3015543d14fa9989c1ef7fb8b5a0is based on the UI squash mergeef217a415fea44500c19b9434db2ec40fa288547.git range-diffconfirms the telemetry patch is unchanged; current main's WebSocket test import is preserved. Required hosted CI passed for this exact head: 115 successful jobs, 16 scope-based skips, and no failures. The requiredopenclaw/ci-gateis green. Fresh exact-head ClawSweeper review found no actionable findings or remaining before-merge actions.