{"record":{"id":"34424f98998c04f8","repo":"NousResearch/hermes-agent","slug":"background-restart-did-not-return-a-task-id","errorCode":null,"errorMessage":"Background restart did not return a task id","messagePattern":"Background restart did not return a task id","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/src/app/session/hooks/use-preview-routing.ts","lineNumber":50,"sourceCode":"      const sessionId = $focusedRuntimeId.get()\n\n      if (!sessionId) {\n        throw new Error('No active session for background restart')\n      }\n\n      const cwd = $currentCwd.get() || currentCwd || ''\n\n      const result = await requestGateway<{ task_id?: string }>('preview.restart', {\n        context: context || undefined,\n        cwd: cwd || undefined,\n        session_id: sessionId,\n        url\n      })\n\n      const taskId = result.task_id || ''\n\n      if (!taskId) {\n        throw new Error('Background restart did not return a task id')\n      }\n\n      beginPreviewServerRestart(taskId, url)\n\n      return taskId\n    },\n    [currentCwd, requestGateway]\n  )\n\n  const handleDesktopGatewayEvent = useCallback<EventHandler>(\n    event => {\n      baseHandleGatewayEvent(event)\n\n      if (event.type === 'preview.open') {\n        // Agent-driven open in response to an explicit user request (\"show\n        // cnn.com in the preview pane\"). Honor it for any session that's ON\n        // SCREEN — the primary chat or an open tile — not only the focused\n        // one: the turn's window routing already scoped the event to this","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/src/app/session/hooks/use-preview-routing.ts#L32-L68","documentation":"Error \"Background restart did not return a task id\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/src/app/session/hooks/use-preview-routing.ts:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the restart; the gateway response was incomplete.","Check gateway connectivity and confirm the background task toolset is enabled.","Restart the preview manually from the preview pane."],"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"}