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
- Remote Control server running in server mode, hosting several sessions.
- From the Claude mobile app, a disconnect action was triggered on a session.
- 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
- Fix the
session_url null-deref on the disconnect path.
- Document (or add) safe single-session recovery in server mode.
- Confirm child-session lifecycle when the server restarts (killed vs reparented).
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: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
api.anthropic.com), Max planclaude remote-control --name "<name>" --spawn=same-dir --capacity=8 --permission-mode bypassPermissionsccd-clisessions (fleet); UUIDs redacted.What happened
Cannot read properties of undefined (reading 'session_url')and reported "failed to disconnect."Server-side evidence
remote-server.logshows the RPC socket tearing down at the same moment a client detached:Reads as: client disconnected abruptly; the disconnect handler dereferenced
session_urlon an object that was already undefined (session metadata lost during the socket teardown) →TypeError.Impact
claude remote-control list/stop/statusto 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,
/contextsent to the same session responded normally. So the session was never actually disconnected — the failure is purely in the disconnect path.Expected
session_url(or the session object) and either complete or fail gracefully with a real recovery hint.Requests
session_urlnull-deref on the disconnect path.