NousResearch/hermes-agent · error · Error

Remote Hermes gateway is selected, but no session token is s

Error message

Remote Hermes gateway is selected, but no session token is saved. Open Settings → Gateway and save a token, or switch back to Local.

What it means

Thrown in remote-backend resolution when the connection mode is remote/token-auth and no token is available. The OAuth branch above returns early with token: null (REST is cookie-authed via the partition); reaching the `if (!token)` throw means the connection is token-mode and the saved config/environment yielded no usable token.

Source

Thrown at apps/desktop/electron/main.ts:7232

      )
    }

    return {
      baseUrl,
      mode: 'remote',
      source,
      authMode: 'oauth',
      remoteHost: host || undefined,
      remoteIdentity,
      remoteKind,
      // No static token in OAuth mode; REST is cookie-authed via the partition.
      token: null,
      wsUrl: buildGatewayWsUrlWithTicket(baseUrl, ticket)
    }
  }

  if (!token) {
    throw new Error(
      'Remote Hermes gateway is selected, but no session token is saved. ' +
        'Open Settings → Gateway and save a token, or switch back to Local.'
    )
  }

  return {
    baseUrl,
    mode: 'remote',
    source,
    authMode: 'token',
    remoteHost: host || undefined,
    remoteIdentity,
    remoteKind,
    token,
    wsUrl: buildGatewayWsUrl(baseUrl, token)
  }
}

View on GitHub (pinned to c896c09c42)

Solutions

  1. Open Settings → Gateway and save a valid session token for the remote, then reconnect.
  2. Or switch the connection back to Local.
  3. If the gateway supports it, use OAuth authMode so no static token is needed.
Defensive patterns

Strategy: validation

Validate before calling

function remoteConnectionReady(connection) {
  if (connection.mode !== 'remote') return true
  if (connection.authMode === 'oauth') return true // cookie-authed
  return Boolean(connection.token)
}

Type guard

function hasUsableRemoteToken(conn) {
  return conn.authMode === 'oauth' || Boolean(conn.token)
}

Try / catch

try {
  await resolveRemoteBackend(conn)
} catch (e) {
  if (/no session token is saved/.test(e.message)) openGatewaySettings()
  else throw e
}

Prevention

When it happens

Trigger: Connecting with the remote gateway selected after the saved token was cleared, failed to decrypt, or was never saved; switching Settings → Gateway to a remote URL without completing the token field; a profile-scoped remote override lacking its own token where inheritance doesn't apply.

Common situations: Users flipping to Remote mode and immediately connecting; token lost to a keyring reset; using a fresh profile with no per-profile remote override.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/048c708d2ebbbea9. Report an issue: GitHub.