paperclipai/paperclip · error

CreateOS process output was evicted before it could be read.

Error message

CreateOS process output was evicted before it could be read.

What it means

Reconnecting to a CreateOS process's output stream returned HTTP 410 Gone, meaning the server has already evicted the buffered output for that process (the requested `after` cursor offset is expired). The plugin maps this to a distinct error because the process may still be running but its past output can never be recovered.

Solutions

  1. Consume the output stream promptly; avoid long pauses between process creation and the first /connect call.
  2. Reduce process output volume or redirect it to a sandbox file and read it back via /files.
  3. Increase the CreateOS server's output retention/buffer size if you control it.
  4. Catch this error and re-run the command, treating the previous run's stdout/stderr as lost.
  5. Do not simply retry the same process: the missing output cannot be recovered from it.

Example fix

// before
spawn(); await longPreparation(); connect(after=0)  // output may be evicted
// after
const p = spawn(); const out = connect(p, after=0); await longPreparation(); // read first
Defensive patterns

Strategy: try-catch

Try / catch

try { const r = await execute(client, params, signal); }
catch (e) {
  if (e instanceof Error && e.message.includes("output was evicted")) {
    // output unrecoverable; re-run command, do not retry same process
  } else throw e;
}

Prevention

When it happens

Trigger: Calling execute with a long delay before reading output, a long-running process whose output buffer exceeds the server retention window, or reconnecting to a process whose output ring buffer rotated past the client's cursor, so the /connect?after=N request answers 410.

Common situations: Very chatty process producing megabytes of output while the client is slow or paused (e.g. under debugger/network stall); undersized CreateOS output-retention setting; resuming after a long outage where the process kept running.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/8b29eed5bef78009. Report an issue: GitHub.

Appendix: source

Thrown at packages/plugins/sandbox-providers/createos/src/execute.ts:142

      if (error instanceof CreateosApiError && error.status < 500) creationMayHaveSucceeded = false;
      throw error;
    }
    processId = identifier(created.process_id);
    // No interactive stdin for ordinary commands; any supplied input comes
    // from the staged file, avoiding a write-vs-fast-exit race.
    try { await client.json(`${base}/${processId}/stdin/close`, "POST", undefined, signal); }
    catch (error) {
      if (!(error instanceof CreateosApiError && error.status === 409)) throw error;
    }
    let reconnects = 0;
    for (;;) {
      signal.throwIfAborted();
      let response: Response;
      try {
        response = await client.request(`${base}/${processId}/connect?after=${cursor}`, { signal });
      } catch (error) {
        if (error instanceof CreateosApiError && error.status === 410) {
          throw new Error("CreateOS process output was evicted before it could be read.");
        }
        if (signal.aborted || (error instanceof CreateosApiError && error.status < 500 && error.status !== 429)) throw error;
        if (++reconnects > 3) throw new Error("CreateOS process output connection failed.");
        await delay(250, undefined, { signal });
        continue;
      }
      try {
        for await (const event of events(response)) {
          if (event.type === "heartbeat") continue;
          if (event.type === "data") {
            const seq = event.seq;
            if (typeof seq !== "number" || !Number.isSafeInteger(seq) || seq < 1) throw new Error("CreateOS process sequence is invalid.");
            if (seq <= cursor) continue;
            if (seq !== cursor + 1) throw new Error("CreateOS process output has a sequence gap.");
            if ((event.stream !== "stdout" && event.stream !== "stderr") ||
                typeof event.data_base64 !== "string" ||
                !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(event.data_base64)) {
              throw new Error("CreateOS process output is invalid.");

View on GitHub (pinned to 3f1d897a7c)