What happened?
The macOS/OpenClawKit gateway client does not classify PROTOCOL_MISMATCH connect failures as terminal. The TypeScript Control UI client has its own reconnect policy, but the Swift GatewayChannel path uses GatewayConnectAuthError.isNonRecoverable to decide whether reconnect should pause after a structured connect failure. Since PROTOCOL_MISMATCH is not represented in GatewayConnectAuthDetailCode, the Swift path can treat an incompatible client/server protocol as recoverable and keep reconnecting.
Reproduction
On origin/main at 21d1e1f0fc9d:
- Have a gateway reject the Swift client
connect response with structured details:
{
"code": "INVALID_REQUEST",
"message": "protocol mismatch",
"details": { "code": "PROTOCOL_MISMATCH" }
}
- Let
GatewayChannel handle the connection failure.
Expected behavior
PROTOCOL_MISMATCH is parsed as a known detail code and treated as non-recoverable so the macOS/Swift client does not reconnect-loop until the client or server version changes.
Actual behavior
The detail code is unknown to the Swift enum and is not included in isNonRecoverable, so reconnect pause logic does not classify it as terminal.
Environment
- Source checkout:
21d1e1f0fc9d
- Area: macOS/OpenClawKit gateway startup/connect
- Related: Control UI browser-side mismatch handling also needs terminal classification
What happened?
The macOS/OpenClawKit gateway client does not classify
PROTOCOL_MISMATCHconnect failures as terminal. The TypeScript Control UI client has its own reconnect policy, but the SwiftGatewayChannelpath usesGatewayConnectAuthError.isNonRecoverableto decide whether reconnect should pause after a structured connect failure. SincePROTOCOL_MISMATCHis not represented inGatewayConnectAuthDetailCode, the Swift path can treat an incompatible client/server protocol as recoverable and keep reconnecting.Reproduction
On
origin/mainat21d1e1f0fc9d:connectresponse with structured details:{ "code": "INVALID_REQUEST", "message": "protocol mismatch", "details": { "code": "PROTOCOL_MISMATCH" } }GatewayChannelhandle the connection failure.Expected behavior
PROTOCOL_MISMATCHis parsed as a known detail code and treated as non-recoverable so the macOS/Swift client does not reconnect-loop until the client or server version changes.Actual behavior
The detail code is unknown to the Swift enum and is not included in
isNonRecoverable, so reconnect pause logic does not classify it as terminal.Environment
21d1e1f0fc9d