{"record":{"id":"687ceed96f539ab6","repo":"NousResearch/hermes-agent","slug":"active-hermes-profile-changed-while-connecting","errorCode":null,"errorMessage":"Active Hermes profile changed while connecting","messagePattern":"Active Hermes profile changed while connecting","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/store/projects.ts","lineNumber":366,"sourceCode":"): Promise<T> {\n  return gateway.request<T>(method, params)\n}\n\ninterface ActiveProjectsContext {\n  gateway: HermesGateway\n  profile: string\n}\n\nasync function activeProjectsContext(): Promise<ActiveProjectsContext> {\n  const profile = $activeGatewayProfile.get() || 'default'\n  let gateway = activeGateway()\n\n  if (!gateway || gateway.connectionState !== 'open') {\n    gateway = await ensureActiveGatewayOpen()\n  }\n\n  if (!gateway || gateway !== activeGateway() || profile !== ($activeGatewayProfile.get() || 'default')) {\n    throw new Error('Active Hermes profile changed while connecting')\n  }\n\n  return { gateway, profile }\n}\n\nfunction applyPayload(payload: ProjectsPayload): void {\n  $projects.set(payload.projects ?? [])\n  $activeProjectId.set(payload.active_id ?? null)\n}\n\n// Pull the full project list + active pointer. Best-effort: a failure (gateway\n// not up yet) leaves the cached atoms intact so the sidebar doesn't flicker.\nexport async function refreshProjects(): Promise<void> {\n  try {\n    applyPayload(await gatewayRequest<ProjectsPayload>('projects.list'))\n    markProjectsRpcSuccess()\n  } catch (err) {\n    markProjectsRpcFailure(err)","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/src/store/projects.ts#L348-L384","documentation":"Error \"Active Hermes profile changed while connecting\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/src/store/projects.ts:366 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the connection after the active profile settles.","Avoid switching profiles while a connection attempt is in flight."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}