Skip to content

[Bug]: macOS GatewayChannel reconnects after protocol mismatch failures #98442

Description

@haruaiclone-droid

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:

  1. Have a gateway reject the Swift client connect response with structured details:
{
  "code": "INVALID_REQUEST",
  "message": "protocol mismatch",
  "details": { "code": "PROTOCOL_MISMATCH" }
}
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions