Repository navigation
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 8, 2026, 9:29 PM ET / September 9, 2026, 01:29 UTC (Revision 6). ClawSweeper reviewWhat this changesThe voice-call webhook server returns HTTP 404 before closing unknown WebSocket upgrades, handles rejection-time socket errors, and adds transport regression coverage. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still silently closes unmatched upgrades. The earlier socket-error and regression-proof concerns are resolved, and no blocking defect remains. Priority: P2 Review scores
Verification
How this fits togetherThe voice-call plugin runs inside the Gateway and receives carrier webhooks and audio-stream connections. Its upgrade router sends recognized streams to their handlers and rejects unknown paths. flowchart TD
A[Incoming WebSocket upgrade] --> B[Voice-call webhook server]
B --> C{Recognized stream path?}
C -->|Realtime| D[Realtime handler]
C -->|Media| E[Media handler]
C -->|Unknown| F[Install socket error guard]
F --> G[Flush HTTP 404 and close]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +200. Total +203 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep rejection handling at the unmatched-route owner, using the supported shared transport helper while preserving recognized stream handlers. Do we have a high-confidence way to reproduce the issue? Yes: with a voice stream handler enabled, an upgrade to an unknown path reaches bare socket.destroy() on current main. Source inspection establishes the path; the supplied baseline TCP transcript corroborates the empty response. Is this the best way to solve the issue? Yes: the patch reuses the existing flush helper and supplies error ownership only where HTTP has relinquished the unmatched socket; the declared minimum host exports that helper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 03497256f95a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
dfcadf0 to
6e15cdf
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Cursor <[email protected]>
6e15cdf to
1b3bc6a
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Use the existing WebSocket rejection helper for unmatched voice upgrades and own socket errors while its response is pending. Preserve realtime and media handler ownership. Replace the timing-based peer-disconnect test with a real-server transport fault that observes the server error without handling it. Verify HTTP 404 bytes, guard-removal failure, and recognized realtime/media routing.
Use valid provider configuration for each audio mode and preserve separate realtime and media handler ownership. Collect socket text through its string-or-buffer contract without a cast. Verified normal Gateway plugin startup and TCP rejection for both modes, with the existing observed-error and guard-removal evidence retained.
|
Thanks @hugenshen! Landed in 0b4864b with your contributor credit preserved. Proof: Normal Gateway/plugin startup passed in separate realtime and streaming configurations. The PR body retains redacted before/after transport output and the deterministic socket-error regression. Exact-head CI passed, with fresh independent behavior and source reviews.
Recognized realtime/media and malformed-upgrade controls retain their behavior. Validation used isolated loopback traffic and no real carrier calls or credentials. All earlier failed proof and CI attempts remain recorded separately. |
…w#141315) Return HTTP 404 before closing unmatched voice WebSocket upgrades and handle socket errors while that rejection is pending. Preserve existing realtime and media handler ownership. Replace timing-based disconnect coverage with an observed server-side transport fault and a guard-removal regression. Validate real TCP rejection, recognized upgrades, and webhook siblings. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Unmatched WebSocket upgrades to the voice-call webhook server close without an HTTP response. Clients see a reset or empty connection close instead of a readable rejection. Once the server writes a rejection, it must also own socket errors during that write because Node has transferred the upgraded socket out of HTTP error handling.
Why This Change Was Made
Use the existing SDK rejection helper to flush HTTP 404, with an error guard installed first and only for unmatched upgrades. Recognized realtime and media streams retain their existing handlers and error ownership.
Replace the peer-disconnect-and-sleep test with a deterministic fault at the real server socket. A non-handling error monitor observes the actual error while the rejection write is pending. Removing only the production guard makes the same regression fail with that uncaught error. Test fixtures now validate separate, supported audio modes.
User Impact
Clients receive a readable HTTP 404 for unknown voice stream paths. Socket errors during rejection do not escape as uncaught process errors. Existing realtime, media, and ordinary webhook behavior stays intact.
Evidence
Normal Gateway/plugin startup, tested separately for realtime and classic streaming. Both configurations pass
openclaw voicecall setup --json; service logs report the voice-call runtime initialized. Tests use isolated loopback networks, a mock carrier for realtime, and inert synthetic carrier settings for streaming. No real carrier request, credential, or public exposure is involved.Redacted output from both modes:
The final revision changes only tests, so the verified candidate runtime retains its actual build identity. A fresh independent validator passed 24 TCP/HTTP checks across both Gateway-started modes, including random paths, fragmented requests, repeated requests, fresh WebSocket handshake verification, and both setup commands.
Deterministic error regression:
This injects a fault through Node's real
destroy(error)path. It does not claim that a peer sent an operating-system reset packet. The monitors observe without handling the error.Retains @hugenshen's original contribution and commit ancestry. AI-assisted.