Skip to content

No safe way to get an agent token when the desktop socket is unavailable #1920

Description

@khaliqgant

Found by a teammate's Claude Code session during a Teams sign-up and Sessions setup on 2026-10-07 (macOS arm64, Desktop 2026.10.10, Claude Code 2.1.153, agent-relay CLI 12.4.0).

When the desktop socket route fails, an agent's fallback for messaging a peer is agent-relay message dm send, which needs RELAY_AGENT_TOKEN. The only documented way to get one is agent-relay agent register, which can rotate an existing identity's token and break the session currently using it. So there's no safe fallback.

Ask: a read-only or non-rotating way to get a token for the current session's own identity (e.g. agent-relay agent token --current, or reuse via the session's existing credentials). Or document a supported fallback that doesn't rotate.

Related: the relaycast MCP from CLI 12.4.0 (agent-relay-mcp.js) failed to connect at Claude Code startup with "Connection closed"; current setup skills expect CLI 13.x.

Activity

  1. added a commit that references this issue on Oct 8, 2026
  2. khaliqgant commented on Oct 8, 2026

    @khaliqgant
    MemberAuthor

    The desktop socket didn't fail here. It was slow: GET /agents took about 26 s because each request ran session discovery, which waited on Codex IPC. The root cause is fixed in relay-desktop#333.

    The documented fallback is now the same socket with a longer (60 s) timeout. We're not adding a CLI token path: many users don't have the npm agent-relay CLI, so it isn't the right fallback.

    #1921 now keeps only the rotation guard. agent-relay agent register fails for an existing name and leaves that identity's token unchanged unless you pass --rotate explicitly.

    That PR also includes a separate fix for the MCP "Connection closed" startup exit. The published 13.1.5 still has that bug, and the PR has the evidence.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions