{"record":{"id":"6b28d7ff670c0d43","repo":"paperclipai/paperclip","slug":"paperclip-runner-provider-changed","errorCode":"paperclip_runner_provider_changed","errorMessage":"Paperclip Runner provider changed after this run selected its native backend.","messagePattern":"Paperclip Runner provider changed after this run selected its native backend\\.","errorType":"error_code","errorClass":"PaperclipRunnerProviderProfileError","httpStatus":null,"severity":"error","filePath":"server/src/services/native-runtime/provider-profile.ts","lineNumber":456,"sourceCode":"    id: string;\n    profileKey: string;\n    anthropicAgentId: string;\n    agentVersion: string;\n    environmentId: string;\n    betaVersion: string;\n    defaultModel: string;\n    defaultMaxListCostCents: number;\n  } | null;\n  agentCoreProfile?: {\n    id: string;\n    profileKey: string;\n    configuration: Record<string, unknown>;\n  } | null;\n}): PaperclipRunnerNativeProviderInput {\n  const config = asRecord(input.adapterConfig);\n  const profile = resolvePaperclipRunnerProviderProfile(config);\n  if (profile.backend !== input.backend) {\n    throw new PaperclipRunnerProviderProfileError(\n      \"paperclip_runner_provider_changed\",\n      \"Paperclip Runner provider changed after this run selected its native backend.\",\n    );\n  }\n  if (profile.provider === \"opencode\") {\n    return {\n      provider: \"opencode\",\n      model: profile.model,\n      opencodePermissionMode: resolvePaperclipRunnerPermissionMode(\n        \"opencode\",\n        config.opencodePermissionMode,\n      ) as \"allow\" | \"ask\" | \"deny\",\n    };\n  }\n  if (profile.provider === \"acpx\") {\n    return {\n      provider: \"acpx\",\n      model: profile.model,","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/native-runtime/provider-profile.ts#L438-L474","documentation":"Guard in resolvePaperclipRunnerNativeProviderInput: the backend resolved from the persisted adapterConfig must equal the backend this run already selected for its native runtime; if the provider changed after run selection, a 'paperclip_runner_provider_changed...' error is thrown. This prevents mid-run provider swaps (e.g. codex -> claude_managed) that would invalidate the already-initialized execution context.","triggerScenarios":"Thrown at server/src/services/native-runtime/provider-profile.ts:450 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Revert the adapterConfig provider change until the run completes, or cancel and start a new run with the new provider.","Re-create the run so backend selection and adapterConfig agree.","Investigate what mutated adapterConfig mid-run (UI save, migration, import) and gate such edits during active runs."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-02T18:44:00.616Z","contentChangedAt":"2026-09-02T18:44:00.616Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}