Skip to content

Remote Control (server mode): 'failed to disconnect' — TypeError reading 'session_url' #81155

Description

@ragnar-claude

Bug report: Remote Control "failed to disconnect" — Cannot read properties of undefined (reading 'session_url')

Summary

In Remote Control server mode, a disconnect action initiated from the mobile app fails with a client-side TypeError:

Remote Control failed to disconnect: Cannot read properties of undefined (reading 'session_url')

The disconnect does not complete. The hosted session remains alive and usable (verified — see below), so the error is cosmetic but alarming: it surfaces as a red failure with no clean recovery and no documented remediation.

Environment

  • Claude Code: 2.1.218 (native build); embedded remote CLI ccd-cli 2.1.219
  • Platform: Linux (headless droplet), first-party auth (api.anthropic.com), Max plan
  • Mode: Remote Control server
    claude remote-control --name "<name>" --spawn=same-dir --capacity=8 --permission-mode bypassPermissions
  • Server hosts multiple concurrent child ccd-cli sessions (fleet); UUIDs redacted.

What happened

  1. Remote Control server running in server mode, hosting several sessions.
  2. From the Claude mobile app, a disconnect action was triggered on a session.
  3. Client threw Cannot read properties of undefined (reading 'session_url') and reported "failed to disconnect."

Server-side evidence

remote-server.log shows the RPC socket tearing down at the same moment a client detached:

14:31:53 [frameSink] write failed, detaching: write unix .../rpc.sock->@: write: broken pipe
14:31:53 [Server] writeResponse: wrote 0/69 bytes, error=... broken pipe
14:31:53 [Server] Failed to write response: ... broken pipe
14:31:53 [Server] scanner error on @: read unix .../rpc.sock->@: read: connection reset by peer

Reads as: client disconnected abruptly; the disconnect handler dereferenced session_url on an object that was already undefined (session metadata lost during the socket teardown) → TypeError.

Impact

  • Cosmetic but there is no clean recovery path. Docs don't cover: whether the session is wedged, how to reconnect after a failed disconnect, or how to stop one session without killing the whole server.
  • In server mode there is no claude remote-control list/stop/status to manage a single hosted session, so the only "reset" is restarting the whole server — which drops every hosted session. Bad for a multi-session fleet.

Confirmed: session survives

After the error, /context sent to the same session responded normally. So the session was never actually disconnected — the failure is purely in the disconnect path.

Expected

  • Disconnect should null-check session_url (or the session object) and either complete or fail gracefully with a real recovery hint.
  • Server mode should expose per-session lifecycle (list / stop / status) so one session can be cleared without dropping the server.

Requests

  1. Fix the session_url null-deref on the disconnect path.
  2. Document (or add) safe single-session recovery in server mode.
  3. Confirm child-session lifecycle when the server restarts (killed vs reparented).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions