{"record":{"id":"0b07d9950ebc8f8a","repo":"pbakaus/impeccable","slug":"impeccable-ignoring-saved-live-session-from-anot","errorCode":null,"errorMessage":"[impeccable] Ignoring saved live session from another project (","messagePattern":"\\[impeccable\\] Ignoring saved live session from another project \\(","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"skill/scripts/live-browser.js","lineNumber":9236,"sourceCode":"      pageUrl: location.pathname,\n      paramValues: { ...paramsCurrentValues },\n      parameterState: parameterGenerationState,\n      insertPlaceholder: insertPlaceholderSnapshot || undefined,\n      pickedAnchor: pickedAnchorSnapshot || undefined,\n      pickedAnchorViewportTop: Number.isFinite(pickedAnchorViewportTop) ? pickedAnchorViewportTop : undefined,\n      pageHash: location.hash || undefined,\n      pageSearch: location.search || undefined,\n    });\n  }\n\n  function loadSession() {\n    const saved = sessionState.loadSession();\n    // localStorage is per-origin, and two projects routinely reuse the same\n    // localhost port. A saved session stamped with another project's appRoot\n    // is that project's leftover, never a session this server can complete;\n    // resuming it freezes the picker behind an unfinishable banner.\n    if (saved?.appRoot && APP_ROOT && saved.appRoot !== APP_ROOT) {\n      console.warn('[impeccable] Ignoring saved live session from another project (' + saved.appRoot + ').');\n      sessionState.clearSession();\n      return null;\n    }\n    return saved;\n  }\n\n  function clearSession() {\n    sessionState.clearSession();\n  }\n\n  /** Mark session as handled (accepted/discarded). The agent will clean up\n   *  the source, but until it does the wrapper is still in the HTML. This\n   *  prevents resumeSession from picking it up again after reload. */\n  function markSessionHandled() {\n    if (!currentSessionId) return;\n    sessionState.markHandled(currentSessionId);\n  }\n","sourceCodeStart":9218,"sourceCodeEnd":9254,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/skill/scripts/live-browser.js#L9218-L9254","documentation":"Before adopting a saved session from localStorage, the script compares the saved session's appRoot against the current APP_ROOT. localStorage is per-origin, and two projects routinely reuse the same localhost port, so a session stamped with another project's appRoot is that project's leftover and can never be completed by this server. The script logs this warning, clears the saved session, and returns null so the picker starts fresh.","triggerScenarios":"Page load resumes a saved session when saved?.appRoot is set and differs from the current APP_ROOT — i.e. a different project previously saved a live session on the same origin (same host:port).","commonSituations":"Two dev projects sharing localhost:3000/5173; copying localStorage between environments; switching repos without clearing browser storage; running the same port for frontend and a different app previously used with impeccable.","solutions":["Nothing needed — the stale session is cleared automatically; just pick an element.","Give each project a distinct dev port so their localStorage namespaces do not collide.","Manually clear localStorage for the origin if you want to remove leftovers proactively.","Avoid restoring another checkout's browser profile/storage into this project."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const saved = sessionState.loadSession();\nif (saved?.appRoot && APP_ROOT && saved.appRoot !== APP_ROOT) {\n  sessionState.clearSession();\n  return null; // leftover from another project on the same origin\n}","typeGuard":"function isOwnSession(saved, currentAppRoot) {\n  return Boolean(saved) && (!saved.appRoot || saved.appRoot === currentAppRoot);\n}","tryCatchPattern":null,"preventionTips":["Run each project on its own port so per-origin localStorage never collides.","Clear site data when switching between projects that share a port.","Never reuse a browser profile across checkouts expecting session continuity.","Keep appRoot stamping intact when copying or migrating saved sessions."],"tags":["localstorage","port-collision","session","browser","projects"],"backgroundTag":"stale-session-state","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"}