pbakaus/impeccable · error · Error

${String(res.status)}

Error message

${String(res.status)}

What it means

Thrown when fetching the session manifest from the local engine server (/source endpoint) returns a non-OK status. The script needs the manifest to verify that the published source at the expected path belongs to the current session; without it the mount-failure re-report check cannot proceed. The error carries only the numeric status as a string.

Source

Thrown at skill/scripts/live-browser.js:5775

      try { runtime.unmount(mountedInstance); } catch { /* non-fatal */ }
    }
    removeSvelteComponentVariantStyle(svelteComponentSession);
    wrapperEl.parentElement.replaceChild(committed, wrapperEl);
    svelteComponentSession = null;
    svelteRuntimePromise = null;
    selectedElement = committed;
    return true;
  }

  async function injectSvelteComponentsFromManifest(manifestPath, sessionId) {
    // Every (re)injection is a fresh attempt: reset the failure dedupe so a
    // republish that is STILL broken at the same URL reports again instead of
    // being swallowed while the agent believes the repair landed.
    lastReportedMountFailure = null;
    const url = 'http://localhost:' + PORT + '/source?token=' + TOKEN + '&path=' + encodeURIComponent(manifestPath);
    try {
      const res = await fetch(url);
      if (!res.ok) throw new Error(String(res.status));
      const manifest = JSON.parse(await res.text());
      if (manifest.id !== sessionId) {
        // A manifest at the expected path belonging to a different session is
        // an agent-side publish error. Left as a bare return it stranded the
        // bar in GENERATING with no explanation and no event.
        const mismatch = 'Manifest at ' + manifestPath + ' belongs to session ' + (manifest.id || 'unknown') + ', not ' + sessionId + '.';
        reportVariantMountFailed(sessionId, visibleVariant || 1, manifestPath, mismatch);
        showMountErrorCard(sessionId, {
          variant: visibleVariant || 0,
          url: manifestPath,
          message: 'The variant manifest is for a different session. Ask the agent to republish.',
          previewFile: manifestPath,
        });
        return;
      }

      const paramsByVariant = await loadSvelteComponentParams(manifest);
      const availableVariants = Number(manifest.arrivedVariants) || Number(manifest.count) || 1;

View on GitHub (pinned to 2bc2879276)

Solutions

  1. Read the numeric status: 404 means the manifest is gone — republish the source from the agent; 401/403 means the token is stale — reload the page against the current dev server
  2. Confirm the dev server process is alive and listening on PORT (netstat/lsof)
  3. Reload the browser tab so the script re-handshakes and picks up a fresh TOKEN
  4. Re-run the agent publish step so the manifest exists at the expected manifestPath

Example fix

// before
if (!res.ok) throw new Error(String(res.status));
// after
if (!res.ok) throw new Error('manifest fetch failed: HTTP ' + res.status + ' for ' + manifestPath);
Defensive patterns

Strategy: retry

Validate before calling

const head = await fetch(url);
if (!head.ok) console.warn('manifest not readable:', head.status, manifestPath);

Try / catch

try {
  const res = await fetch(url);
  if (!res.ok) throw new Error(String(res.status));
} catch (err) {
  showToast('Could not verify the manifest (HTTP ' + err.message + '). Republish and try again.', 3500);
  lastReportedMountFailure = null;
}

Prevention

When it happens

Trigger: fetch('http://localhost:PORT/source?token=...&path=manifestPath') resolves with res.ok === false — typically 404 when the manifest file was deleted/moved, or 401/403 when TOKEN no longer matches the running server session.

Common situations: Dev server restarted so the old token is invalid; manifest path changed after a rebuild; file removed by git checkout or a clean while the live session was open.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of pbakaus/impeccable@2bc2879276 (2026-09-08). Data as JSON: /api/errors/c525f1550a896f25. Report an issue: GitHub.