{"record":{"id":"93608e6680bc430e","repo":"vercel/ai","slug":"harnessid-acp-cold-restoration-completed-withou","errorCode":null,"errorMessage":"${harnessId} ACP cold restoration completed without identifying the negotiated method.","messagePattern":"(.+?) ACP cold restoration completed without identifying the negotiated method\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/acp-v1-harness.ts","lineNumber":1023,"sourceCode":"        });\n      }),\n    );\n    channel.onClose((_code, reason) => {\n      settle({\n        error: new Error(\n          `${harnessId} ACP bridge closed during cold restoration: ${reason}`,\n        ),\n      });\n    });\n    try {\n      channel.send(start);\n    } catch (error) {\n      settle({ error });\n    }\n  }).then(result => {\n    if (result.error !== undefined) throw result.error;\n    if (result.method == null) {\n      throw new Error(\n        `${harnessId} ACP cold restoration completed without identifying the negotiated method.`,\n      );\n    }\n    return result.method;\n  });\n}\n\nfunction createSession({\n  sessionId,\n  harnessId,\n  channel,\n  proc,\n  modelMapping,\n  defaultModelId,\n  sessionMeta,\n  instructionMapping,\n  outputSchemaMapping,\n  debug,","sourceCodeStart":1005,"sourceCodeEnd":1041,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/acp-v1-harness.ts#L1005-L1041","documentation":"restoreColdACPSession sends a start message over the bridge and waits for the restoration round-trip to settle with a negotiated restoration method ('resume' or 'load'). If the promise settles successfully but result.method is still null — i.e. the channel finished without ever recording which method was negotiated — this error is thrown, indicating an internal protocol invariant violation during cold restoration.","triggerScenarios":"Cold-restoring an ACP session where the bridge channel emits 'finish' before any restoration method (resume/load) was captured — e.g. the agent process completed the handshake in an unexpected order, or the response carrying the negotiated method was never routed to the settle callback.","commonSituations":"Agent CLI version mismatches that change the session-restore handshake; flaky bridge/IPC behavior where the method response is dropped; restoring state produced by a different protocol version; rare race conditions between finish and method capture.","solutions":["Retry the cold restoration / restart the harness — this is often a transient handshake race.","Verify the agent CLI version matches what @ai-sdk/harness-acp expects (upgrade the harness package or pin the agent version).","Inspect bridge logs for the restoration message exchange to see whether the method response was sent.","Ensure persisted cold-session state came from the same protocol version ('v1')."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const method = await restoreColdACPSession(/* ... */);\n} catch (error) {\n  if (error instanceof Error && error.message.includes('cold restoration completed without identifying the negotiated method')) {\n    // transient handshake issue: retry once, then fall back to a fresh session\n    await restartHarness();\n  } else {\n    throw error;\n  }\n}","preventionTips":["Pin the agent CLI version compatible with your @ai-sdk/harness-acp release.","Retry cold restoration once before failing over to a fresh session.","Only restore cold-session state written by the same protocol version.","Enable bridge debug logging to capture handshake drops early."],"tags":["acp","session-restore","protocol","race-condition"],"backgroundTag":"session-restore-failed","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}