Repository navigation
fix: keep a native-admin upgrade reset from exiting the API - #1663
kevinlin-openai merged 4 commits into
Conversation
Attach a socket error listener before admission awaits. A client reset in that gap is ECONNRESET, and Node exits when that event has no listener. The conformance test opens the production upgrade handler, resets the client while admission is still pending, and expects no uncaught exception. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 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 October 8, 2026, 12:35 AM ET / 04:35 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch handles native-admin client resets during WebSocket admission, preserves denial audits, and prevents disconnected clients from opening gateway connections. Example: A client resets an upgrade to agent-a.agents.example.test while admission waits
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful: current main still has the admission-time socket-error gap. The earlier audit and CI-registration findings are fixed, and no actionable patch defect remains. Likely related people: kevinlin-openai and freeqaz are relevant routing candidates from native-admin history and review context. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherOpenClaw Control Plane proxies an authorized operator’s browser connection to an Agent’s private OpenClaw gateway. The changed admission handler checks the session and exact-Agent permission before starting that connection. flowchart TD
A[Browser WebSocket upgrade] --> B[Guard client socket errors]
B --> C[Check session and exact-Agent permission]
C -->|Denied| D[Record attributable denial audit]
C -->|Allowed| E{Client still connected?}
E -->|No| F[Stop without gateway connection]
E -->|Yes| G[Resolve private transport and recheck client]
G --> H[Proxy to Agent gateway]
Technical reviewBest possible solution: Keep socket-error handling at the production admission boundary while preserving exact-Agent denial audits and existing gateway authorization. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes an unhandled socket-error interval during admission, and the contributor reports a real TCP reset producing ECONNRESET before the fix. This read-only review did not execute it. Is this the best way to solve the issue? Yes: attaching the listener before the await repairs the owning boundary without changing authentication, settings, or persisted state; the disconnected-client guards retain denial auditing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ccb76e6a89ae. Provenance checked
TestingProof path: in-process harness. Added test files: 1. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
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 HistoryReview history (3 earlier review cycles)
|
Suite audit rejects a conformance file that no lane owns. Put the upgrade reset test on the same checks lane as the slack proxy reset. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
Free's clanker here (an AI agent reviewing on Free's behalf). Review of The crash. Confirmed. With the Agreeing with the bot's denial-audit point. The The second check also fixes an older leak. On main, if the client goes away during admission and admission then succeeds, Interaction with the recent relay changes (#1659, #1666). Those changed how The suite JSON change only registers the new local-TCP test. I found no CI-surface concerns. This is ready once the denial ordering is fixed; it's for a maintainer to merge. |
Admission can finish as an authorization denial after the socket is already destroyed. Writing that audit before the destroyed-socket return keeps the principal and the Agent decision. The conformance case resets during a pending denial and expects one authorization_denial row. With the old return, that row count stays 0. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Yes. The denial branch now runs before the destroyed-socket return. A reset while exact-Agent authorization is still pending still appends one authorization_denial row, with the principal and the Agent. The return before the gateway proxy stays, so a disconnected caller does not open that socket. Commit 002d0f7. |
kevinlin-openai
left a comment
There was a problem hiding this comment.
Reviewed the native-admin upgrade reset path at 82fbec8. The listener covers admission-time socket errors, denial auditing remains attributable, and disconnected clients stop before gateway proxying. The required flow update is included. Merge remains subject to the current-head CI gates.
…in reset gaps (wip) Mutation sweep of openclaw#851 and openclaw#1663: controller list grammar and operate checks, deploy-time deployer and catalog checks, store list and snapshot invariants, bearer-token gateway validation and profiles, dispatch-time snapshot matching, and upgrade resets during a successful admission.
What Problem This Solves
A native-admin WebSocket upgrade waits for admission before the proxy attaches a socket error listener. If the client resets the TCP connection during that wait, Node reports ECONNRESET on the socket. With nobody listening, that event exits the API process.
Evidence
The command imports
createNativeAdminAccessfrom this tree, sends an upgrade toagent-a.agents.example.test, and resets the socket while admission is still waiting.Before the listener:
After the listener:
Real behavior proof
node /tmp/ent-upgrade-proof.mjs, which callscreateNativeAdminAccess, writes the upgrade, thenresetAndDestroywhileadmissionVerifier.verifyis still pending.uncaught ECONNRESET read ECONNRESETand exited 2.