vercel/ai · error · Error

${harnessId} recovered this turn through disk replay only an

Error message

${harnessId} recovered this turn through disk replay only and has no restored ACP process for a subsequent prompt.

What it means

This harness session was recovered from persisted disk state via event replay after the ACP bridge process was lost, but no live ACP agent process was restored. Disk replay can rebuild the conversation history, yet it cannot reconstitute a live ACP process, so the session is marked replay-only and cannot accept a new prompt (doPromptTurn). Callers must resume from a suspend/detach handle that includes a live bridge, or start a fresh session.

Source

Thrown at packages/harness-acp/src/v1/acp-v1-harness.ts:1418

        skills: options.skills,
        abortSignal: options.abortSignal,
      });
      if (options.responseFormat?.type === 'json') {
        if (options.responseFormat.schema == null) {
          throw unsupported({
            harnessId,
            message: `${harnessId} requires a JSON schema for structured output.`,
          });
        }
        if (outputSchemaMapping == null) {
          throw unsupported({
            harnessId,
            message: `${harnessId} does not support structured output through ACP.`,
          });
        }
      }
      if (replayOnly) {
        throw new Error(
          `${harnessId} recovered this turn through disk replay only and has no restored ACP process for a subsequent prompt.`,
        );
      }
      if (options.abortSignal?.aborted) {
        throw (
          options.abortSignal.reason ??
          new DOMException('Aborted', 'AbortError')
        );
      }
      const prompt = convertHarnessPromptToACPTextBlocks({
        prompt: options.prompt,
        harnessId,
      });
      const model = options.model ?? defaultModelId;
      const turnStartConfig = createACPTurnStartConfig({
        prompt,
        tools: options.tools ?? [],
        builtinTools,

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Start a fresh session (createACPV1) and seed it with the replayed history instead of prompting the replay-only session.
  2. Check the session's lifecycle data recovery/restoration status before prompting and only prompt sessions whose recovery restored a live ACP process.
  3. If the bridge process is still alive on the original host, resume using the persisted bridge data (port/token/lastSeenEventId) so a live process is restored rather than replay-only.
  4. Wrap promptTurn in try-catch and treat this as terminal for the session; migrate any pending work to a new session.

Example fix

// before
await session.promptTurn({ prompt: 'continue' }); // throws: replay-only recovery
// after
const recovery = sessionLifecycleData.recovery;
if (recovery?.mode === 'disk-replay') {
  session = await createACPV1({ /* fresh session, seed with replayed history */ });
}
await session.promptTurn({ prompt: 'continue' });
Defensive patterns

Strategy: fallback

Validate before calling

const isReplayOnly = (data) => data?.recovery?.mode === 'disk-replay' || data?.recovery?.replayOnly === true;
if (isReplayOnly(lifecycleData)) { /* recreate session before prompting */ }

Type guard

function canPrompt(session: { lifecycle: { recovery?: { mode?: string } } }): boolean {
  return session.lifecycle.recovery?.mode !== 'disk-replay';
}

Try / catch

try {
  await session.promptTurn({ prompt });
} catch (e) {
  if (e instanceof Error && e.message.includes('disk replay only')) {
    session = await createACPV1({ /* fresh session, seed replayed history */ });
    await session.promptTurn({ prompt });
  } else throw e;
}

Prevention

When it happens

Trigger: Calling promptTurn (doPromptTurn in the session returned by createSession/createACPV1) on a session whose lifecycle data was recovered with recoveryStatus indicating disk replay only (replayOnly=true), e.g. after restoring from persisted ACP lifecycle data that lacked a live bridge connection.

Common situations: Resuming a harness session from persisted state after a machine/container restart where the ACP agent process died; restoring a session snapshot on a different host than the one that ran the original process; attempting a subsequent prompt after recovery reported 'disk replay' recovery instead of a restored bridge.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/189edb75fd26204a. Report an issue: GitHub.