Skip to content

[Repo Assist] fix(chat): surface incompatible-gateway state when handshake lacks session key#482

Merged
shanselman merged 1 commit into
masterfrom
repo-assist/fix-incompatible-gateway-session-key-459-f4f1202398c7e4a1
May 21, 2026
Merged

[Repo Assist] fix(chat): surface incompatible-gateway state when handshake lacks session key#482
shanselman merged 1 commit into
masterfrom
repo-assist/fix-incompatible-gateway-session-key-459-f4f1202398c7e4a1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Fixes #459. When the gateway handshake completes but does not advertise sessionDefaults.mainSessionKey or the legacy mainKey alias (an incompatible/outdated gateway), the composer was silently disabled with no user-visible explanation — the connection label read "Connected" but nothing could be sent.

Root Cause

OpenClawChatDataProvider.BuildSnapshot used _status == Connected as the sole input for the ConnectionStatus label, regardless of whether the handshake actually resolved a session key. The UI had no way to distinguish "connected and ready" from "connected but gateway is incompatible".

Changes

File Change
OpenClawChatDataProvider.cs Emit "Incompatible gateway" as ConnectionStatus when HasHandshakeSnapshot=true but MainSessionKey is null/empty while connected
OpenClawChatRoot.cs Map the "Incompatible" prefix to a new "incompatible-gateway" connState token
OpenClawComposer.cs Handle "incompatible-gateway" → disable inputs + show Chat_Composer_Placeholder_IncompatibleGateway placeholder
Resources.resw (5 locales) Add Chat_Composer_Placeholder_IncompatibleGateway = "Gateway update required — incompatible version"
OpenClawChatDataProviderTests.cs Add 2 focused tests for the incompatible-handshake path

Trade-offs

  • The "Incompatible gateway" string prefix is a sentinel convention (matched via StartsWith("Incompatible", ...) in OpenClawChatRoot). This is consistent with how "Connected" and "Connecting" are already matched.
  • Non-English locales get the English fallback string for Chat_Composer_Placeholder_IncompatibleGateway for now; proper translations can follow once the copy is approved.
  • The diagnostic does not pop a notification toast — the placeholder text is sufficient as a first-pass indicator. A richer error surface (e.g. a banner or a status tooltip) could be added later if desired.

Test Status

  • ✅ 2 new tests added and passing: LoadAsync_HandshakeComplete_NoSessionKey_SignalsIncompatibleGateway, StatusChanged_IncompatibleGateway_IsReflectedInSnapshotConnectionLabel
  • OpenClaw.Tray.Tests: 1093 passed, 10 pre-existing failures (LocalGatewaySetupTests — Windows WSL tests that fail on Linux)
  • OpenClaw.Shared.Tests: 1796 passed, 7 pre-existing failures (platform-specific, unrelated)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

…ssion key

When the gateway handshake completes but does not advertise a
mainSessionKey (or the legacy mainKey alias), the composer was showing
"Connected" with a disabled-but-unlabelled send box. The user had no
indication that the gateway needed updating.

Changes:
- OpenClawChatDataProvider: emit "Incompatible gateway" as
  ConnectionStatus when HasHandshakeSnapshot=true but MainSessionKey is
  null/empty and the socket is Connected, instead of plain "Connected".
- OpenClawChatRoot: map the "Incompatible" prefix to the new
  "incompatible-gateway" connState token.
- OpenClawComposer: handle "incompatible-gateway" → disable inputs +
  show Chat_Composer_Placeholder_IncompatibleGateway placeholder.
- Resources.resw (all 5 locales): add
  Chat_Composer_Placeholder_IncompatibleGateway string.
- OpenClawChatDataProviderTests: add two focused tests for the
  incompatible-handshake path (snapshot ConnectionStatus and
  ComposeTarget.IsReady=false).

Closes #459

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shanselman shanselman merged commit d62a8f2 into master May 21, 2026
7 checks passed
@shanselman shanselman deleted the repo-assist/fix-incompatible-gateway-session-key-459-f4f1202398c7e4a1 branch May 21, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show clear compatibility message when gateway lacks main session key

1 participant