{"record":{"id":"99b197bcf7561d20","repo":"pbakaus/impeccable","slug":"impeccable-the-live-server-has-no-record-of-sess","errorCode":null,"errorMessage":"[impeccable] The live server has no record of session ","messagePattern":"\\[impeccable\\] The live server has no record of session ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"skill/scripts/live-browser.js","lineNumber":7399,"sourceCode":"        abandonForeignSession(msg.id);\n        return null;\n      }\n      return handleFailure(new Error(body.error || ('HTTP ' + res.status + ' ' + res.statusText)));\n    }).catch(handleFailure);\n\n    if (msg.type === 'generate' || msg.type === 'steer') {\n      const creation = doSend();\n      sessionCreationGate = creation.then(() => {}, () => {});\n      return creation;\n    }\n    return sessionCreationGate.then(doSend);\n  }\n\n  let abandonedForeignSessionId = null;\n  function abandonForeignSession(sessionId) {\n    if (abandonedForeignSessionId === sessionId || sessionId !== currentSessionId) return;\n    abandonedForeignSessionId = sessionId;\n    console.warn('[impeccable] The live server has no record of session ' + sessionId + '; clearing stale local state.');\n    markSessionHandled();\n    cleanup({ instantChrome: true });\n    showToast('A saved live session belonged to a different project, so it was cleared. Pick an element to start fresh.', 6000);\n  }\n\n  function checkpointPayload(reason) {\n    return {\n      type: 'checkpoint',\n      id: currentSessionId,\n      revision: sessionState.nextCheckpointRevision(),\n      revisionDomain: 'browser',\n      owner: browserOwner,\n      phase: String(state || '').toLowerCase(),\n      reason,\n      pageUrl: location.pathname,\n      expectedVariants,\n      arrivedVariants,\n      visibleVariant,","sourceCodeStart":7381,"sourceCodeEnd":7417,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/skill/scripts/live-browser.js#L7381-L7417","documentation":"When the browser sends a checkpoint event, the live server can refuse with error 'unknown_session' if it has never journaled that session id. This happens when the browser carries localStorage state from another project or a wiped store (two apps sharing the same localhost port). abandonForeignSession clears the stale local state once and hands the surface back to the picker, because continuing would freeze the picker behind a session that can never complete.","triggerScenarios":"A checkpoint POST to the live server returns {error:'unknown_session'} for msg.id === currentSessionId — i.e. a saved session resumed in a different project that happens to reuse the same localhost port, or after the server's session store was wiped/reset.","commonSituations":"Two projects developed on the same port (e.g. both localhost:5173); server restarted with a cleared session store; switching between branches/projects without clearing localStorage; resuming an old saved session after reinstalling the engine.","solutions":["Nothing to fix manually — the script clears the stale state itself; pick an element to start a fresh session.","Use different ports per project to avoid per-origin localStorage collisions.","Clear site data (localStorage) for the origin if stale sessions keep appearing.","Re-pick the element in the current project so the server journals a new session id."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const res = await sendCheckpoint(msg);\n// server-side guard before adopting local state:\nif (res?.body?.error === 'unknown_session') {\n  // local state is stale/foreign: clear and re-pick\n  markSessionHandled();\n  cleanup({ instantChrome: true });\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assign each project a unique dev port to avoid per-origin localStorage collisions.","Clear localStorage for localhost origins when switching projects.","After wiping/resetting the server store, clear browser session state too.","Treat unknown_session on checkpoint as 'stale local state', not a server bug."],"tags":["session","localstorage","port-collision","browser","state-sync"],"backgroundTag":"entity-not-found","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}