{"record":{"id":"7c855f2b38449919","repo":"paperclipai/paperclip","slug":"paperclip-runner-claude-managed-beta-unqualified","errorCode":"paperclip_runner_claude_managed_beta_unqualified","errorMessage":"The Claude Managed profile beta version is not qualified.","messagePattern":"The Claude Managed profile beta version is not qualified\\.","errorType":"error_code","errorClass":"PaperclipRunnerProviderProfileError","httpStatus":null,"severity":"error","filePath":"server/src/services/native-runtime/provider-profile.ts","lineNumber":497,"sourceCode":"      ) as \"approve-all\" | \"approve-reads\" | \"deny-all\",\n    };\n  }\n  if (profile.provider === \"claude_managed\") {\n    const stored = input.managedProfile;\n    if (\n      !stored\n      || (\n        profile.managedProfileId !== stored.id\n        && profile.managedProfileId !== stored.profileKey\n      )\n    ) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_claude_managed_profile_mismatch\",\n        \"The qualified Claude Managed profile does not match the adapter selection.\",\n      );\n    }\n    if (stored.betaVersion !== CLAUDE_MANAGED_BETA_VERSION) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_claude_managed_beta_unqualified\",\n        \"The Claude Managed profile beta version is not qualified.\",\n      );\n    }\n    const model = profile.model ?? optionalString(stored.defaultModel);\n    const maxSessionListCostUsd = profile.maxSessionListCostUsd\n      ?? stored.defaultMaxListCostCents / 100;\n    if (!model) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_claude_managed_model_invalid\",\n        \"The Claude Managed profile requires a model.\",\n      );\n    }\n    if (model !== CLAUDE_MANAGED_QUALIFIED_MODEL) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_claude_managed_model_unqualified\",\n        `The Claude Managed profile requires exact model ${CLAUDE_MANAGED_QUALIFIED_MODEL}.`,\n      );","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/native-runtime/provider-profile.ts#L479-L515","documentation":"When a run selects the claude_managed backend, resolvePaperclipRunnerNativeProviderInput loads the stored Claude Managed agent profile and requires its betaVersion to equal CLAUDE_MANAGED_BETA_VERSION ('managed-agents-2026-04-01'). This beta version gates the Anthropic Managed Agents API contract ('anthropic-beta' header) Paperclip is qualified against. If the stored profile records any other beta version, the run is refused rather than executed against an unqualified API surface.","triggerScenarios":"A run executes with provider=claude_managed and a stored managedProfile whose betaVersion field differs from 'managed-agents-2026-04-01' — e.g. the profile was created by an older CLI (setupManagedAgent) or server version before the current beta string, or the profile row's betaVersion was hand-edited.","commonSituations":"Upgrading Paperclip (server or @paperclipai CLI) where managed agent profiles created under a previous beta version persist in the database; restoring an old database snapshot with stale profiles; Anthropic changing the managed-agents beta date while local profile records lag behind.","solutions":["Re-register the managed agent profile with the current CLI so setupManagedAgent stores betaVersion='managed-agents-2026-04-01' (paperclip managed-agent setup / setupManagedAgent).","Update the profile row's betaVersion to CLAUDE_MANAGED_BETA_VERSION via the managed-agent profile service or admin API, then retry the run.","Upgrade the Paperclip server and packages to matching versions so the qualification check and profile storage agree on the beta version.","If a downgrade is intentional, pin/restore the code version that matches the stored betaVersion instead of changing data."],"exampleFix":"// before (stored profile)\n{ \"profileKey\": \"acme-managed\", \"betaVersion\": \"managed-agents-2026-01-15\", ... }\n// after\n{ \"profileKey\": \"acme-managed\", \"betaVersion\": \"managed-agents-2026-04-01\", ... }","handlingStrategy":"validation","validationCode":"import { CLAUDE_MANAGED_BETA_VERSION } from \"@paperclipai/cli/managed-agent\";\nif (profile.provider === \"claude_managed\" && storedProfile.betaVersion !== CLAUDE_MANAGED_BETA_VERSION) {\n  throw new Error(`Profile ${storedProfile.profileKey} needs re-registration: beta ${storedProfile.betaVersion} != ${CLAUDE_MANAGED_BETA_VERSION}`);\n}","typeGuard":"const isQualifiedBeta = (p: { betaVersion?: string | null }): p is { betaVersion: typeof CLAUDE_MANAGED_BETA_VERSION } =>\n  p.betaVersion === CLAUDE_MANAGED_BETA_VERSION;","tryCatchPattern":"try {\n  await executeRun(run);\n} catch (e) {\n  if (e instanceof PaperclipRunnerProviderProfileError && e.code === \"paperclip_runner_claude_managed_beta_unqualified\") {\n    await reRegisterManagedAgentProfile(profile.managedProfileId); // refresh betaVersion, then retry once\n  } else throw e;\n}","preventionTips":["Re-run managed agent setup after every Paperclip or CLI upgrade so stored betaVersion matches the current CLAUDE_MANAGED_BETA_VERSION","Alert on managed profile rows whose betaVersion differs from the constant","Never hand-edit the betaVersion column; always regenerate via setupManagedAgent","Pin server and CLI versions together so qualification constants agree"],"tags":["configuration","version-mismatch","claude-managed","provider-profile"],"backgroundTag":"provider-profile-not-qualified","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"}