{"record":{"id":"d84308657aa0aadf","repo":"vercel/ai","slug":"acp-process-loss-rerun-requires-the-agent-to-adver","errorCode":null,"errorMessage":"ACP process-loss rerun requires the agent to advertise sessionCapabilities.resume; a fresh unrelated ACP session will not be created.","messagePattern":"ACP process-loss rerun requires the agent to advertise sessionCapabilities\\.resume; a fresh unrelated ACP session will not be created\\.","errorType":"exception","errorClass":"HarnessBridgeCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/bridge/recovered-session.ts","lineNumber":30,"sourceCode":"  }): Promise<acp.PromptResponse>;\n  nextUpdate(): Promise<acp.ActiveSessionMessage>;\n  dispose(): void;\n};\n\nexport function assertACPResumeCapability({\n  initialization,\n  harnessId,\n}: {\n  initialization: ACPInitializeResult;\n  harnessId: string;\n}): void {\n  const sessionCapabilities = initialization.agentCapabilities\n    ?.sessionCapabilities as Readonly<Record<string, unknown>> | undefined;\n  if (\n    sessionCapabilities?.resume == null ||\n    sessionCapabilities.resume === false\n  ) {\n    throw new HarnessBridgeCapabilityUnsupportedError({\n      harnessId,\n      message:\n        'ACP process-loss rerun requires the agent to advertise sessionCapabilities.resume; a fresh unrelated ACP session will not be created.',\n    });\n  }\n}\n\nexport function createACPRecoveredSession({\n  agent,\n  sessionId,\n  restorationResponse,\n  updates,\n}: {\n  agent: acp.ClientContext;\n  sessionId: string;\n  restorationResponse: acp.ResumeSessionResponse | acp.LoadSessionResponse;\n  updates: ReturnType<typeof createACPRecoveredSessionUpdates>;\n}): ACPActiveSession {","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/recovered-session.ts#L12-L48","documentation":"assertACPResumeCapability checks that the agent's initialization response advertises agentCapabilities.sessionCapabilities.resume. Rerunning after a process loss requires resuming the same ACP session; if the agent cannot resume, the library throws a HarnessBridgeCapabilityUnsupportedError instead of silently creating a fresh, unrelated session (which would lose context).","triggerScenarios":"Attempting a process-loss rerun (ensureSession) against an agent whose initialization lacks sessionCapabilities.resume or advertises resume: false.","commonSituations":"Older agent versions that do not implement resume; agent implementations that only support fresh sessions; a capability negotiation where the agent omits sessionCapabilities entirely.","solutions":["Upgrade the ACP agent to a version that advertises sessionCapabilities.resume.","Update the agent's initialization response to include agentCapabilities.sessionCapabilities.resume: true if it does support resuming.","Use a harness/run mode that tolerates fresh sessions if resume cannot be supported.","Verify the correct agent binary/implementation is being launched (an older one may be on PATH)."],"exampleFix":"// agent initialize result (before)\n{ agentCapabilities: {} }\n// after\n{ agentCapabilities: { sessionCapabilities: { resume: true } } }","handlingStrategy":"validation","validationCode":"const caps = initialization.agentCapabilities?.sessionCapabilities as Record<string, unknown> | undefined;\nif (caps?.resume == null || caps.resume === false) {\n  console.warn('Agent cannot resume sessions; process-loss rerun will fail.');\n}","typeGuard":"function supportsResume(initialization: ACPInitializeResult): boolean {\n  const caps = initialization.agentCapabilities?.sessionCapabilities as\n    | Readonly<Record<string, unknown>>\n    | undefined;\n  return caps?.resume != null && caps.resume !== false;\n}","tryCatchPattern":"import { HarnessBridgeCapabilityUnsupportedError } from '...';\ntry {\n  await ensureSession();\n} catch (error) {\n  if (HarnessBridgeCapabilityUnsupportedError.isInstance?.(error) || (error as Error).message.includes('sessionCapabilities.resume')) {\n    // fall back to a fresh-session workflow\n    return;\n  }\n  throw error;\n}","preventionTips":["Check advertised capabilities right after initialize and choose run modes accordingly.","Keep the agent binary up to date in your environment.","Document the minimum agent version supporting resume in your deployment config."],"tags":["acp","capability","session","resume"],"backgroundTag":"unsupported-capability","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}