{"record":{"id":"0a0c8aa830a37787","repo":"openai/codex-plugin-cc","slug":"this-codex-version-does-not-support-claude-session","errorCode":null,"errorMessage":"This Codex version does not support Claude session transfer. Update Codex with `npm install -g @openai/codex@latest`, then retry.","messagePattern":"This Codex version does not support Claude session transfer\\. Update Codex with `npm install -g @openai/codex@latest`, then retry\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/lib/codex.mjs","lineNumber":1073,"sourceCode":"  });\n}\n\nexport async function importExternalAgentSession(cwd, options = {}) {\n  const availability = getCodexAvailability(cwd);\n  if (!availability.available) {\n    throw new Error(\"Codex CLI is not installed or is missing required runtime support. Install it with `npm install -g @openai/codex`, then rerun `/codex:setup`.\");\n  }\n  if (!options.sourcePath) {\n    throw new Error(\"A Claude session source path is required.\");\n  }\n\n  return withDirectAppServer(cwd, async (client) => {\n    emitProgress(options.onProgress, \"Importing Claude session into Codex.\", \"transferring\");\n    try {\n      await requestExternalAgentSessionImport(client, externalAgentSessionMigration(options.sourcePath, cwd));\n    } catch (error) {\n      if (error?.rpcCode === -32601) {\n        throw new Error(\n          \"This Codex version does not support Claude session transfer. Update Codex with `npm install -g @openai/codex@latest`, then retry.\",\n          { cause: error }\n        );\n      }\n      throw error;\n    }\n    const threadId = importedThreadIdForSource(options.sourcePath);\n    if (!threadId) {\n      const stderr = cleanCodexStderr(client.stderr);\n      throw new Error(\n        `Codex reported that the Claude import completed, but did not record an imported thread.${stderr ? `\\n${stderr}` : \" Check the Codex app-server logs for the underlying import error.\"}`\n      );\n    }\n    emitProgress(options.onProgress, `Claude session imported (${threadId}).`, \"completed\", { threadId });\n    return {\n      threadId,\n      stderr: cleanCodexStderr(client.stderr)\n    };","sourceCodeStart":1055,"sourceCodeEnd":1091,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/lib/codex.mjs#L1055-L1091","documentation":"Thrown by importExternalAgentSession when the RPC call 'externalAgentConfig/import' is rejected with rpcCode -32601 (JSON-RPC method not found). That code means the connected Codex app-server does not implement the external-agent import method, i.e. the installed Codex is older than the feature. The error is wrapped with { cause: error } preserving the original RPC failure.","triggerScenarios":"Calling importExternalAgentSession against a Codex app-server built before the externalAgentConfig/import method shipped. The request reaches a live (but old) app-server, which returns -32601, caught in the try/catch around requestExternalAgentSessionImport.","commonSituations":"A pinned older @openai/codex version is installed. The broker started a previously-installed codex binary that has since been partly upgraded. A system-wide old Codex shadows the global npm install on PATH.","solutions":["Upgrade Codex: npm install -g @openai/codex@latest.","Stop any running shared broker (so a fresh app-server spawns from the new binary) then retry.","Confirm 'codex --version' shows a version that includes externalAgentConfig/import.","If a stale broker persists, clear the session dir's broker artifacts or reboot to release the socket."],"exampleFix":"// before\nawait importExternalAgentSession(cwd, { sourcePath }) // throws -32601 on old codex\n\n// after\n//   npm install -g @openai/codex@latest\n//   (restart the broker / new terminal)\nawait importExternalAgentSession(cwd, { sourcePath })","handlingStrategy":"try-catch","validationCode":"// Probe version support before importing if you can query it; otherwise rely on the catch.\n// After upgrade, confirm: codex --version reports a version that supports externalAgentConfig/import.","typeGuard":"function isMethodNotFound(error) {\n  return error?.rpcCode === -32601;\n}","tryCatchPattern":"try {\n  await importExternalAgentSession(cwd, { sourcePath });\n} catch (error) {\n  if (error?.rpcCode === -32601 || /does not support Claude session transfer/.test(error.message)) {\n    // instruct upgrade, then offer to retry after npm install -g @openai/codex@latest\n  } else {\n    throw error;\n  }\n}","preventionTips":["Keep Codex on @latest so the import RPC is available.","Restart the broker after upgrading so an old app-server is not reused.","Surface the version requirement in transfer docs.","In CI, assert the installed version supports external-agent import."],"tags":["codex","claude-transfer","version","rpc"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}