Skip to content

[Bug]: Cannot pair local node on macOS: generated /ws endpoint returns HTML #366

@SimoMay

Description

@SimoMay

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • I am using the latest version of Moltis
  • If this happened during a chat session, I included as much full session context as possible and redacted secrets

What happened?

Settings → Nodes generated a node pairing command that does not work with the installed Moltis CLI.

The UI generated:

moltis node run --host ws://127.0.0.1:54398/ws --token <token>

But the installed CLI does not support node run. Running moltis node --help shows only:

  • generate-token
  • list
  • add
  • remove
  • status
  • logs

Trying the documented equivalent with node add also fails:

moltis node add --host ws://127.0.0.1:54398/ws --token <token> --foreground

This returns:

Error: HTTP error: 200 OK

Further investigation showed:

  • ws://127.0.0.1:54398/ws/chat upgrades correctly as a websocket
  • ws://127.0.0.1:54398/ws returns the main HTML app page instead of a websocket endpoint
  • multiple likely node websocket routes also return the HTML app page

So the Nodes UI appears to generate both:

  1. an unsupported CLI subcommand (node run)
  2. an unusable websocket path (/ws) for node pairing in this setup

Expected behavior

I expected Settings → Nodes to generate a pairing command that is compatible with the installed CLI and points to a real node websocket endpoint.

Specifically:

  • the generated command should use a supported subcommand
  • the generated websocket URL should connect successfully
  • local node pairing should work for a local Moltis gateway

Steps to reproduce

  1. Install Moltis 0.10.17 via Homebrew on macOS arm64

  2. Start the local Moltis gateway

  3. Open Settings → Nodes

  4. Generate a token/command

  5. Observe that the UI generates a command like:

    moltis node run --host ws://127.0.0.1:54398/ws --token <token>
  6. Run:

    moltis node --help

    and observe that node run is not a supported subcommand

  7. Try the generated command anyway and see it fail due to unsupported subcommand

  8. Try the documented equivalent:

    moltis node add --host ws://127.0.0.1:54398/ws --token <token> --foreground
  9. Observe the error:

    Error: HTTP error: 200 OK
    
  10. Probe websocket routes and observe:

    • /ws/chat works
    • /ws returns HTML instead of websocket upgrade behavior

Did this happen during a chat session?

Yes

Chat session context (if applicable)

I was trying to pair my Mac as a Moltis node so the assistant could use a host-installed CLI (`summarize`) from chat.

We discovered:
- sandbox execution could not access the host-installed CLI
- the recommended workaround was to connect the Mac as a node
- node pairing failed because the generated command was invalid for the installed CLI
- further debugging showed the generated websocket path also did not behave like a node websocket endpoint

Error messages / logs

Generated command from the UI:


moltis node run --host ws://127.0.0.1:54398/ws --token <token>


CLI help:


Manage remote nodes (generate-token, add, remove, list)

Usage: moltis node [OPTIONS] <COMMAND>

Commands:
  generate-token
  list
  add
  remove
  status
  logs
  help


Running the UI-generated command:


error: unrecognized subcommand 'run'


Trying the documented equivalent:


moltis node add --host ws://127.0.0.1:54398/ws --token <token> --foreground


Output:


2026-03-08T16:09:56.168065Z  INFO moltis: moltis starting version="0.10.17"
2026-03-08T16:09:56.168401Z  INFO moltis_node_host::runner: connecting to gateway url=ws://127.0.0.1:54398/ws node_id=1d76c123-a345-4931-a804-33a0fcc0557d
Error: HTTP error: 200 OK


Websocket probing:

`/ws/chat`:


HTTP/1.1 101 Switching Protocols
connection: upgrade
upgrade: websocket


`/ws`:


HTTP/1.1 200 OK
content-type: text/html; charset=utf-8


Installed web asset evidence:

`page-nodes.js` generates a command using:


moltis node run --host ${wsUrl} --token ${res.payload.deviceToken}


with:


${proto}//${host}${port ? `:${port}` : ""}/ws


while chat websocket code uses:


new WebSocket(`${proto}//${location.host}/ws/chat`)

Is this a regression?

I don't know

Last working version

No response

Moltis version

0.10.17

Component

Other

Install method

Homebrew

Operating system

macOS (Apple Silicon)

Additional context

Relevant config snippet:

[server]
bind = "127.0.0.1"
port = 54398

[tls]
enabled = false
auto_generate = true

Additional evidence from installed files:

  • /opt/homebrew/Cellar/moltis/0.10.17/share/moltis/web/js/page-nodes.js generates moltis node run
  • /opt/homebrew/Cellar/moltis/0.10.17/share/moltis/web/js/ws-connect.js uses /ws/chat for chat websocket connections

Suggested direction:

  • either the Nodes UI is generating the wrong command/path
  • or the Homebrew build/UI assets and CLI are out of sync in 0.10.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions