{"record":{"id":"048c708d2ebbbea9","repo":"NousResearch/hermes-agent","slug":"remote-hermes-gateway-is-selected-but-no-session","errorCode":null,"errorMessage":"Remote Hermes gateway is selected, but no session token is saved. Open Settings → Gateway and save a token, or switch back to Local.","messagePattern":"Remote Hermes gateway is selected, but no session token is saved\\. Open Settings → Gateway and save a token, or switch back to Local\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/main.ts","lineNumber":7232,"sourceCode":"      )\n    }\n\n    return {\n      baseUrl,\n      mode: 'remote',\n      source,\n      authMode: 'oauth',\n      remoteHost: host || undefined,\n      remoteIdentity,\n      remoteKind,\n      // No static token in OAuth mode; REST is cookie-authed via the partition.\n      token: null,\n      wsUrl: buildGatewayWsUrlWithTicket(baseUrl, ticket)\n    }\n  }\n\n  if (!token) {\n    throw new Error(\n      'Remote Hermes gateway is selected, but no session token is saved. ' +\n        'Open Settings → Gateway and save a token, or switch back to Local.'\n    )\n  }\n\n  return {\n    baseUrl,\n    mode: 'remote',\n    source,\n    authMode: 'token',\n    remoteHost: host || undefined,\n    remoteIdentity,\n    remoteKind,\n    token,\n    wsUrl: buildGatewayWsUrl(baseUrl, token)\n  }\n}\n","sourceCodeStart":7214,"sourceCodeEnd":7250,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/electron/main.ts#L7214-L7250","documentation":"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.","triggerScenarios":"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.","commonSituations":"Users flipping to Remote mode and immediately connecting; token lost to a keyring reset; using a fresh profile with no per-profile remote override.","solutions":["Open Settings → Gateway and save a valid session token for the remote, then reconnect.","Or switch the connection back to Local.","If the gateway supports it, use OAuth authMode so no static token is needed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function remoteConnectionReady(connection) {\n  if (connection.mode !== 'remote') return true\n  if (connection.authMode === 'oauth') return true // cookie-authed\n  return Boolean(connection.token)\n}","typeGuard":"function hasUsableRemoteToken(conn) {\n  return conn.authMode === 'oauth' || Boolean(conn.token)\n}","tryCatchPattern":"try {\n  await resolveRemoteBackend(conn)\n} catch (e) {\n  if (/no session token is saved/.test(e.message)) openGatewaySettings()\n  else throw e\n}","preventionTips":["Complete Settings → Gateway before selecting Remote","Save a fresh token after keyring changes","Offer OAuth mode to avoid static tokens entirely"],"tags":["gateway","remote","token","auth","connection","desktop"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}