Skip to content

[Bug] Companion cannot connect: Gateway MSIX missing isolated-session contract #1691

Open

Description

@grrgp228-bot

Problem

OpenClaw Companion on Windows cannot connect to the saved “Native Gateway”, so I cannot chat through the desktop app.

The error says that the installed Gateway MSIX does not expose Companion’s isolated-session contract. It asks me to update the Gateway MSIX and retry setup, and says credentials were not sent.

What I tried

  • Uninstalled OpenClaw Companion while keeping the local Gateway and its data.
  • Reinstalled Companion using the official installer.
  • Retried Connect and Save & connect.
  • Tried Open dashboard.

The connection form shows “Gateway reachable”, but connecting still produces the same error. Open dashboard also fails and asks me to check the verified gateway connection.

Expected result

Companion should connect and allow me to chat with my existing agent.

Request

Which Gateway MSIX and Companion versions are compatible with this isolated-session contract? Please provide a supported repair or upgrade procedure that preserves existing conversations and settings.

I have not removed or reset the Gateway.

Activity

  1. added
    P0
    impact:ux-release-blocker
    issue-rating: 🦪 silver shellfish
    on Oct 9, 2026
  2. clawsweeper commented on Oct 9, 2026

    @clawsweeper

    Codex review: this still needs some work.

    Summary
    The documented multi-listener failure is repaired on both default branches, but the original installation remains undiagnosed and a supported, state-preserving upgrade path has not been established.

    Reproducibility: The discussion establishes released-package failures, but current source handles the documented multi-listener trigger; no live reproduction or original-installation diagnosis was performed.

    Maintainer decision needed

    • Question: Which Companion and Gateway distribution pair should affected Store users use for supported, state-preserving recovery?
    • Recommendation: Deliver and verify a supported stable update: Confirm both shipped components contain the repairs and verify upgrading an existing affected installation preserves history, configuration, and paired identity.
    • Why: The source repairs are merged and prerelease Companion installers exist, but stable Companion predates the repair and the supplied proof does not exercise the affected Store upgrade path.

    Next step
    Confirm a supported compatible update pair with state-preservation proof, provide an inline recovery action, and distinguish remaining failures using sanitized operation and listener-status diagnostics.

    Security
    None.

    Review details

    Best possible solution:

    Provide a verified compatible update pair and visible in-product recovery that preserves Gateway state and pairing without relaxing credential checks.

    Do we have a high-confidence way to reproduce the issue?

    The discussion establishes released-package failures, but current source handles the documented multi-listener trigger; no live reproduction or original-installation diagnosis was performed.

    Is this the best way to solve the issue?

    The merged producer and consumer repairs address the established trigger appropriately, while compatibility and recovery need installed-upgrade validation rather than another speculative connection patch.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The original reporter's rejected operation and status fields remain unknown, so the multi-listener repair cannot explain every reported failure.
    • A verified supported upgrade preserving conversations, configuration, and paired identities has not been established for the affected Store installations.

    Codex review notes: model internal, reasoning medium; reviewed against 8393459317d0.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P0: Affected community installations cannot connect or chat, and the reported update guidance offers no demonstrated in-product recovery.
    • impact:ux-release-blocker: Recovery currently depends on package commands, configuration changes, or maintainer guidance rather than an effective setup or recovery action.
    Evidence reviewed

    Acceptance criteria:

    • Verify selected published Companion and Gateway artifacts contain both merged repairs and record their package identities and versions.
    • Exercise an existing-installation upgrade on an authorized disposable Windows host and verify conversations, configuration, and paired identities survive.
    • With an additional Gateway-owned listener active, verify automatic or explicit reconnect, authenticated dashboard access, and a fresh Companion chat reply.
    • Confirm unattested or unrelated listeners still receive no credentials.

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed December 2, 2026, 5:03 AM ET / 10:03 UTC.

  3. reaper32b commented on Oct 14, 2026

    @reaper32b

    Same error here, on a clean switch to all-Store packages.

    • Companion: OpenClawFoundation.OpenClaw 2026.9.803.0 (Microsoft Store)
    • Gateway: OpenClawFoundation.OpenClawGateway 2026.9.900.0 (Microsoft Store)
    • Previously: winget Companion 2026.9.8-1, same error
    • Windows: 10.0.26200
    • Gateway is healthy: /readyz returns ready, Control UI in a browser connects fine
    • Removing the saved gateway and re-adding it with a fresh setup code (ws://127.0.0.1:58067) fails with "could not reach gateway", and the gateway log shows no connection attempt from the Companion
    • Separately hit #167406 (Codex startup stall on MSIX 2026.9.900.0); disabling the codex plugin fixed the gateway but not this
  4. Ace-Divyansh commented on Oct 14, 2026

    @Ace-Divyansh

    I’m also experiencing this on Companion v2026.9.8-1 and Gateway MSIX 2026.9.900.0. Here are additional version details and log findings.

    Companion v2026.9.8-1, x64, Windows 10.0.26300.0; Gateway MSIX 2026.9.900.0 / CLI 2026.9.9. Web dashboard and managed-browser CDP work. Companion operator handshake succeeded, but NodeService credential handoff fails: “installed Gateway MSIX does not expose Companion’s isolated-session contract.” Subsequent native HTTP handoffs report UnknownListener. Gateway currently runs via terminal on loopback port 52348. Managed Edge runs in Windows session 2; interactive desktop is session 1. What is the supported repair for this installed pair without resetting agent state?

  5. stigmundo commented on Oct 18, 2026

    @stigmundo

    Additional reproduction on newer October Windows packages. This appears related to the native Gateway ownership/isolated-session failures described above, although I cannot confirm an identical root cause.

    Environment

    • Windows: 10.0.26300.0
    • Companion (Microsoft Store): OpenClawFoundation.OpenClaw 2026.10.401.0
    • Separately installed native Gateway MSIX: OpenClaw.Gateway 2026.10.400.0
    • Native isolated-session setup; Gateway port 18789

    Working

    • clawctl gateway-service start --json reports Gateway running and listening on port 18789.
    • clawctl open opens a functioning browser Control UI, including agent chat.
    • OpenAI Codex OAuth onboarding completed.
    • clawctl companion prepare --port 18789 succeeds.
    • openclaw devices list shows paired Windows Tray and TUI devices.

    Failing

    • Windows Companion remains disconnected: “The native Gateway could not start or verify its owned endpoint. Check the manually installed MSIX and retry. Credentials were not sent.”
    • Connection timeline: “Blocked strong credential before managed-local endpoint ownership was proven” and “The managed gateway address is owned by an unverified process. OpenClaw did not send the shared or bootstrap token.”
    • Diagnostic log: Local AI ownership discovery is unavailable (InvalidOperationException).
    • Native HTTP credential handoff reports UnknownListener.
    • Companion persists an old “last successful” Gateway URL at ws://127.0.0.1:63015/ (no listener there), while the actual Gateway runs on 18789. Manually targeting 18789 has not resolved ownership verification.
    • An earlier direct connection to 18789 reached the challenge but failed AUTH_TOKEN_MISMATCH; the Tray device was subsequently paired, but the ownership failure persisted.
    • Setup recovery also reports that original Gateway ownership/configuration could not be checked.

    A clean reinstall and fresh isolated-session setup have already been attempted. Windows build exceeds the documented minimum. No ownership/security check has been bypassed.

    Could maintainers confirm whether Companion 2026.10.401.0 and the separately installed OpenClaw.Gateway 2026.10.400.0 package are expected to interoperate, and suggest a non-destructive diagnostic/recovery procedure for the ownership handshake? Sanitised diagnostics can be provided on request.

  6. dolan-dotcom commented on Oct 21, 2026

    @dolan-dotcom

    Additional reproduction with a specific multi-listener cause on the official Windows Gateway release. This may explain some reports in this thread; it does not establish that every report has the same cause.

    Environment observed October 20, 2026

    • Windows 11 x64, build 26300.9711.
    • Store Companion OpenClawFoundation.OpenClaw 2026.10.401.0; executable reports 2026.10.4-alpha.5, commit c2ce4f50eb6313121ffb385e086cf4c4ba7b982b.
    • Store Gateway OpenClawFoundation.OpenClawGateway 2026.10.400.0, packaging commit 19d7cc0aab651c4d940517abcdaeeac1987a06d0.
    • Bundled OpenClaw 2026.10.4, commit 383c124cc32ffee3f8e56f549b88da94d269a4af.
    • One supported Gateway package registered during this reproduction. Gateway configured on loopback port 61393; its launcher configuration explicitly pins that same port.

    Reproduction and observed results

    1. Start the configured native Gateway. The package-qualified clawctl gateway-service status --json reports running, port 61393 and session/process ownership including a nonzero process sequence number. Companion connects successfully.
    2. Run the packaged openclaw browser status --json. It reports the managed browser is stopped, but this initializes another loopback listener on 61403 in the same Gateway Node process. Starting a managed browser is not required to trigger this case.
    3. Repeat the package-qualified clawctl gateway-service status --json. It now returns:
    {
      "ok": true,
      "schemaVersion": 1,
      "command": "gateway-service status",
      "gateway": { "state": "running" },
      "integration": { "kind": "isolated-session", "version": 1 }
    }

    Both gateway.port and gateway.ownership have disappeared while the two Node-owned listeners remain active.

    1. Disconnect and reconnect Companion. It displays: “The installed Gateway MSIX does not expose Companion's isolated-session contract.” Credentials are withheld.
    2. A supported Gateway restart clears the auxiliary listener and allows Companion to connect again. The failure returns when browser functionality initializes the extra listener. Restarting is therefore temporary recovery.

    Source path matching the observations

    In the installed Gateway source, Program.cs, the GatewayStatus handler selects a port only when ObservedPorts has exactly one entry. It discards an explicitly pinned Gateway port even when that port is among the freshly observed listeners.

    ClawCtlJson.FromOwnership requires the selected port before serializing ownership. Companion's parser requires that port for a running Gateway and emits the generic contract error when it is missing.

    The same Count: 1 status selection was still present in upstream main when checked for this report. The observed integration remains version 1; no contract-version edit or ownership bypass is needed to reproduce this failure.

    Local repair deployed and verified — October 20 update

    A local Gateway source change routes status and dashboard endpoint selection through an observed-port selector: select the configured port only when it is among the fresh observations; leave genuinely ambiguous unpinned listeners unresolved. Session identity, listener attribution and process-sequence checks remain enforced. Companion's generic error wording has not been changed; distinguishing missing endpoint information from an unsupported contract remains a suggested Companion improvement.

    Validation now completed:

    • Regression cases exercise the actual status-result mapping and JSON serializer. Multiple-listener cases fail with the original selector and pass with the repair. All 35 targeted status/address/ownership/dashboard tests and the canonical Release analysis/formatting gate pass.
    • All 30 NativeAOT CLI scenarios pass. The production launcher and session helper compiled successfully.
    • Full patched suite: 1,306 passed, 12 failed. The unmodified baseline has the exact same 12 failures: 11 symlink-privilege failures before Developer Mode was enabled, and one Windows PowerShell fixture blocked by execution policy. Tests and security policies were not weakened; the full suite was not rerun after enabling Developer Mode.
    • Deployed a separate local Developer Mode Gateway package, OpenClawFoundation.OpenClawGateway-owned-port version 0.1.2484.14125, using the repository's documented side-by-side patch workflow. The application payload remains the same Store payload/version/commit listed above. This is a local development build, not a Store-signed or officially released fix.
    • With relay 61403 and managed-browser CDP 61404 active, status retained Gateway port 61393 and fresh ownership evidence for all three listeners. Companion disconnect/reconnect succeeded under this formerly failing condition.
    • Companion opened the authenticated dashboard and displayed restored history. Qwen3.5 9B message exchanges passed through the patched Gateway, including a message sent inside Companion after a full Companion process restart through Windows app activation with browser listeners still active.
    • After a supported Gateway restart, browser listeners were recreated; Companion was reconnected and reopened, and another message sent inside Companion received the expected response. This verifies fresh-process ownership rather than relying on a healthy readiness endpoint alone.
    • Migration used verified full backups and a separate isolated profile. All 894 restored state files were hash-verified, five SQLite databases passed integrity checks, and configuration values were preserved except three absolute paths updated for the new profile. The existing Companion device key was verified unchanged. The Store Gateway and recovered data remain available for rollback; only the patch is active on the configured port.

    Separate restart/retry limitation remains

    Restarting Gateway while Companion stays open exposed a separate recovery issue. Companion retried about one second later while Gateway was still starting, then stopped retrying after reporting that the package-managed Gateway was not running on its selected port. Once Gateway was ready, clicking Connect restored native connectivity, but the already-open embedded web chat remained blank until Companion was reopened. Reopening Companion against the ready patched Gateway succeeded with all browser listeners active. Automatic recovery across that restart gap is not claimed fixed by the endpoint-selection patch.

    Tests used Companion's web-chat preference, which avoids a separately observed native WinUI layout-cycle crash. The offending native control has not been established or repaired.

    This confirms a local repair for this reproduced multi-listener case. It does not establish that the original poster or every other reporter has the same cause, and it does not establish availability of an official released repair.

    Could the Windows Gateway packaging maintainers confirm this endpoint-selection defect and provide a released repair preserving existing data and credential protections? The producer is in openclaw/openclaw-windows-packaging; this comment supplies the reproducer missing from the existing Companion symptom report.

    No credentials, device keys, user/account identifiers, private profile paths, conversation content, raw logs, crash dumps or diagnostic attachments are included. Loopback ports and public software versions/source references are retained to make the reproduction useful.

  7. stigmundo commented on Oct 21, 2026

    @stigmundo

    Resolved on my installation — follow-up to my earlier reproduction.

    The Windows desktop app now connects to the native Gateway, and an end-to-end chat message was successfully sent and answered through it.

    What fixed this particular case (no reinstall, package change, data reset, or ownership-check bypass):

    1. clawctl gateway-service status --json confirmed the current native Gateway was running on 127.0.0.1:18789, with valid-looking gateway.ownership data and integration.kind=isolated-session, version 1. The desktop app's saved “Native Gateway” entry still pointed at ws://127.0.0.1:63015.
    2. Removed that obsolete saved connection through the desktop app (not the Gateway installation/data), then used Connect to an existing Gateway → Direct via URL and token, targeting ws://127.0.0.1:18789.
    3. The first attempt reached the Gateway and received AUTH_TOKEN_MISMATCH. The saved shared token was not the current Gateway's token. From the isolated environment, retrieved the current token with clawctl pwsh followed by openclaw gateway auth-token --show, and used it in the connection form.
    4. A subsequent attempt showed Transport error. Checking clawctl gateway-service status --json showed gateway.state=stopped, with the supervisor reporting exit code 1. clawctl gateway-service start --json, followed by status verification, restored the Gateway on port 18789.
    5. Retrying Save & Connect with the current token then produced Gateway pairing approval required, rather than an ownership or token error. clawctl pwsh --command "openclaw devices list" showed one pending OpenClaw Windows Tray pairing request. Approved that specific request using clawctl pwsh --command "openclaw devices approve <pending-request-id>".
    6. After a short delay, the desktop app showed Connected. An actual chat exchange in the desktop app succeeded, with the agent confirming the message had arrived through the Gateway.

    Environment: Windows 10.0.26300.0; desktop OpenClawFoundation.OpenClaw 2026.10.401.0; separately installed native Gateway OpenClaw.Gateway 2026.10.400.0.

    Scope/qualification: This is a verified recovery for my case, not evidence that all reports here share the same cause. The initial ownership-verification message was real, but the working recovery path involved correcting a stale saved endpoint, using the current Gateway auth token, ensuring the Gateway was running, and explicitly approving the new device pairing. The Gateway's transient exit-code-1 stop was not root-caused. The desktop app's tendency to repopulate the obsolete port/token after removing the saved connection may still merit investigation.

  8. added
    clawsweeper:intake:support
    clawsweeper:fix-shape-clear
    and removed
    issue-rating: 🦪 silver shellfish
    clawsweeper:intake:support
    on Oct 25, 2026
  9. 11 remaining items

  10. removed
    clawsweeper:intake:support
    on Nov 14, 2026
  11. vanessasonghong-maker commented on Nov 15, 2026

    @vanessasonghong-maker

    Additional reproduction: Windows 10, Gateway MSIX 2026.11.100.0

    I am experiencing the same Companion connection error described in this issue.

    Environment

    • OS: Windows 10, build 26200.9711
    • Companion: 2026.11.1.0
    • Gateway MSIX: OpenClaw.Gateway 2026.11.100.0
    • Gateway payload: 2026.11.1
    • Gateway package family: OpenClaw.Gateway_kaa03rpbbqef6
    • Gateway URL: ws://127.0.0.1:61150/
    • Integration: isolated-session, version 1

    What works

    1. clawctl setup --json succeeds:

      • ok: true
      • session.state: ready
      • runtime.nodeVersion: 24.22.1
      • recovery.state: configured
      • integration.kind: isolated-session
      • integration.version: 1
      • gatewayLaunch.version: 1
    2. clawctl companion prepare --port 61150 --json also succeeds:

      • ok: true
      • companion.port: 61150

    What fails

    1. In Companion, I select the saved Native Gateway entry (ws://127.0.0.1:61150/) and click Connect.

    2. Companion displays:

      The installed Gateway MSIX does not expose Companion's isolated-session contract. Update the Gateway MSIX, then retry setup. Credentials were not sent.

    3. The error persists even after both setup and companion prepare return success. There is no Retry setup button in the Companion UI.

    Additional Gateway startup findings

    • clawctl gateway-service start --json returned exit code 0 and gateway.state: starting.
    • A subsequent status check, approximately 15 seconds later, reported:
      • session.state: running
      • gateway.state: stopped
      • readiness.state: startup-eligible
      • Supervisor error: application exited with code 1.
    • The state-transfer response reported profileDirectory: C:\Users\M8-B6, hasState: true, pending: false, and empty assets, mappings, and requiredSources.
    • At the time of a separate process check, 127.0.0.1:61150 was listening and owned by node.exe (PID 22272), whose parent was openclaw-session-host.exe (PID 9148).
    • The Gateway launch log also showed an EADDRINUSE error while attempting to bind 127.0.0.1:61150.

    I cannot yet confirm whether the EADDRINUSE startup failure and the Companion contract rejection have the same root cause.

    What I have not done

    • I have not removed or reset the Gateway MSIX.
    • I have not deleted the isolated session or its LocalState data.
    • I have not removed the original OpenClaw profile or its backup.
    • I have not bypassed Companion's endpoint ownership or credential checks.

    Questions for the maintainers

    1. Does this reproduction match the multi-listener endpoint-selection defect discussed in this issue?
    2. Could the missing endpoint/ownership information explain why Companion rejects the contract even though setup and companion prepare both succeed?
    3. Is there a supported, data-preserving recovery or upgrade path for Gateway MSIX 2026.11.100.0?
    4. Could you clarify how to safely resolve the separate EADDRINUSE startup failure without terminating an unverified process or risking the isolated session?

    I would appreciate a supported fix that preserves existing Gateway state, configuration, device identity, and conversations. I can provide reviewed diagnostic logs if needed.

  12. added
    clawsweeper:intake:support
    and removed
    clawsweeper:intake:support
    on Nov 15, 2026
  13. Georgeebi commented on Nov 15, 2026

    @Georgeebi

    Title: Native Gateway contract verification fails despite successful Gateway startup

    Environment

    • OpenClaw Desktop: 2026.11.102.0
    • OpenClaw Gateway MSIX: 2026.11.100.0
    • OpenClaw payload: 2026.11.1
    • Windows build: 26300.9974

    Error
    NativeGatewayContractException: The installed Gateway MSIX does not expose Companion's isolated-session contract.

    Diagnostic findings

    • Gateway setup completed successfully.
    • Isolated-session support was reported as available.
    • Gateway successfully started on ports 18789 and 18790.
    • Subsequent Gateway inspection reported Running.
    • All ten captured Gateway status JSON files reported "state":"running" but "port":0.
    • Microsoft Store reports no available Gateway update.

    Expected behaviour
    The desktop application recognizes and connects to the packaged Native Gateway.

    Actual behaviour
    Desktop setup rejects the Gateway during contract verification despite successful startup.

    Request
    Please confirm whether Gateway MSIX 2026.11.100.0 is compatible with Desktop 2026.11.102.0, and whether the status contract needs to expose the actual listening port and ownership information.

  14. lbartpe commented on Nov 15, 2026

    @lbartpe

    I reproduced the gateway-restart retry gap described above on Windows 11 build 26300, with Store Gateway MSIX 2026.10.900.0 (OpenClaw 2026.10.9). It affected both Store Companion 2026.10.502.0 and standalone Companion 2026.11.3-alpha.104. I left Companion open and ran clawctl gateway-service restart against the existing paired gateway.

    Sanitized trace from the Store Companion run (elapsed from restart):

    Elapsed Observation
    +0 s Gateway restart requested.
    +0.4 s Companion logged disconnected.
    +2–3 s Companion retried and reported the package-managed gateway was not running.
    +4–30 s clawctl gateway-service status --json reported unhealthy and no listener.
    +32 s Status reported running and attributed the loopback listener on port 18789 to the new gateway process, with process sequence evidence present.
    +61 s Companion had still not authenticated or reconnected. The existing node remained paired.

    The standalone alpha could connect the same paired node when launched against a ready gateway. With that Companion left open, another gateway restart reproduced the same pattern: early retries, the attributed listener returning, and no automatic reconnect. The installed alpha tag contains the changes from #1917 and #1986.

    A separate obstacle to the Store path: the installed Store Companion opens a migration screen while the alpha Inno installation is present. It requires a supported migration-capable previous version. No in-place Store update was offered by Windows Package Manager.

    Is there a supported release or state-preserving update path that retries through this startup interval and reconnects the existing operator and node? I can verify a candidate by repeating the gateway restart with Companion open, comparing the paired node identity, and checking a fresh Companion chat reply and its execution history.

  15. added
    clawsweeper:intake:support
    and removed
    clawsweeper:intake:support
    on Nov 15, 2026
  16. Georgeebi commented on Nov 16, 2026

    @Georgeebi

    Thanks for investigating this.

    I'm experiencing a related issue with:

    • Windows 11 build 26300
    • OpenClaw Desktop 2026.11.102.0
    • Gateway MSIX 2026.11.100.0
    • OpenClaw payload 2026.11.1

    My native Gateway setup fails with:

    NativeGatewayContractException: The installed Gateway MSIX does not expose Companion's isolated-session contract.

    The Gateway host log confirms that the isolated-session backend is supported and that the Gateway successfully starts on ports 18789 and 18790.

    However, the diagnostics contain ten captured status JSON files reporting "state": "running" with "port": 0.

    This appears different from the restart/reconnection issue because the desktop application rejects the Gateway during initial contract verification.

    Could you confirm whether the status metadata issue is covered by an existing fix, and whether a supported state-preserving update is available for these Store package versions?

    I'd prefer to preserve my existing Gateway configuration and device pairing.

  17. github-actions commented on Dec 1, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.
    Please add updated OpenClaw Windows details or it will be closed.

  18. added
    issue-rating: 🦪 silver shellfish
    and removed
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0clawsweeper:fix-shape-clearclawsweeper:needs-maintainer-reviewclawsweeper:no-new-fix-primpact:ux-release-blockerissue-rating: 🦪 silver shellfish

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions