fix(ui): track gateway protocol constants#82883
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. from source inspection: current main emits browser protocol Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow constants/test/changelog fix after maintainer review and redacted after-fix runtime or Testbox proof shows the browser Control UI connects to a protocol 5 Gateway. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main emits browser protocol Is this the best way to solve the issue? Yes. Reusing the shared Gateway protocol constants in the browser client and asserting the emitted fields is the narrowest maintainable fix; the remaining blocker is runtime proof, not a different code direction. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7d1317634e5b. |
587ac07 to
0d334cc
Compare
0d334cc to
bd24e31
Compare
|
Landing verification for head bd24e31. Behavior addressed: browser Control UI connect frames now advertise the shared Gateway protocol constants instead of stale protocol 4 literals, so a protocol 5 Gateway is inside the advertised client range. Local proof:
CI proof:
Before evidence:
Evidence after fix:
Known proof gap:
|
Summary
4..4after the Gateway protocol constants moved to5.connectframe withcode=1002 reason=protocol mismatch, leaving the operator UI unable to connect.ui/src/ui/gateway.tsnow usesMIN_CLIENT_PROTOCOL_VERSIONandPROTOCOL_VERSIONfrom the shared Gateway protocol constants, and the node UI gateway test asserts those emitted fields.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
connectframes now advertise the shared current Gateway protocol range instead of stale literal protocol 4 values.31ca8b2a670fcc41513f75cc52f4c506908a59b8; local shell with Nodev24.15.0. The reported failing environment was a browser Control UI served bypnpm ui:devagainst a local Gateway on loopback port18789.MIN_CLIENT_PROTOCOL_VERSION/PROTOCOL_VERSIONand that the regression test asserts both emitted fields.ui/src/ui/gateway.tshas no remainingminProtocol: 4ormaxProtocol: 4literals; the emitted connect params are wired to the shared protocol constants that currently evaluate to5.ui:buildcould not be completed in this local Windows checkout because dependency install and command shims are blocked by local process-spawn permission failures.pnpm installretried once and failed inesbuildpostinstall withspawnSync ... EPERM;node scripts/run-vitest.mjs ui/src/ui/gateway.node.test.tsfailed withspawn EPERM; direct Vitest and Bun Vitest attempts timed out without useful output; Crabbox was unavailable because the local wrapper failed binary sanity checks; WSL had no Node installed.Root Cause (if applicable)
ui/src/ui/gateway.tsencoded protocol 4 as a literal in both theGatewayConnectParamstype andbuildConnectParams, so Gateway protocol bumps did not update the browser Control UI client.minProtocolandmaxProtocolfields against the shared protocol constants.Regression Test Plan (if applicable)
ui/src/ui/gateway.node.test.tsMIN_CLIENT_PROTOCOL_VERSIONasminProtocolandPROTOCOL_VERSIONasmaxProtocol.User-visible / Behavior Changes
The browser Control UI can connect to a protocol 5 Gateway after the protocol bump instead of repeatedly failing the handshake with
protocol mismatch.Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
v24.15.0locally; no container proof.18789; Vite Control UI originhttp://localhost:5173Steps
PROTOCOL_VERSION = 5.pnpm ui:dev.ws://127.0.0.1:18789.Expected
Actual
minProtocol=4andmaxProtocol=4; the Gateway loggedexpectedProtocol=5and closed withcode=1002 reason=protocol mismatch.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
origin/mainstill hardcoded protocol 4 in the browser Control UI; confirmed the patch removes the stale literals and wires the connect builder/test to the shared protocol constants; rangit diff --checkand source-level terminal assertions.minProtocol: 4/maxProtocol: 4literals underui/srcandsrc/gateway/protocol.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations