{"record":{"id":"45eadc9446d67f9c","repo":"paperclipai/paperclip","slug":"source-and-target-paperclip-configs-are-the-same-45eadc","errorCode":null,"errorMessage":"Source and target Paperclip configs are the same. Use --from-config/--from-instance to point repair at a different source.","messagePattern":"Source and target Paperclip configs are the same\\. Use --from-config/--from-instance to point repair at a different source\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":4380,"sourceCode":"  }\n\n  const target = await ensureRepairTargetWorktree({\n    selector: nonEmpty(opts.branch) ?? undefined,\n    seedMode,\n    opts,\n  });\n  if (!target) {\n    p.log.warn(\"Current checkout is the primary repo worktree. Pass --branch to create or repair a linked worktree.\");\n    p.outro(pc.yellow(\"No worktree repaired.\"));\n    return;\n  }\n\n  const source = resolveWorktreeRepairSource(opts);\n  if (!existsSync(source.configPath)) {\n    throw new Error(`Source config not found at ${source.configPath}.`);\n  }\n  if (path.resolve(source.configPath) === path.resolve(target.configPath)) {\n    throw new Error(\"Source and target Paperclip configs are the same. Use --from-config/--from-instance to point repair at a different source.\");\n  }\n\n  const targetConfig = existsSync(target.configPath) ? readConfig(target.configPath) : null;\n  const targetEnvEntries = readPaperclipEnvEntries(resolvePaperclipEnvFile(target.configPath));\n  const targetHasWorktreeEnv = Boolean(\n    nonEmpty(targetEnvEntries.PAPERCLIP_HOME) && nonEmpty(targetEnvEntries.PAPERCLIP_INSTANCE_ID),\n  );\n\n  if (targetConfig && targetHasWorktreeEnv && opts.noSeed) {\n    p.log.message(pc.dim(`Target ${target.label} already has worktree-local config/env. Skipping reseed because --no-seed was passed.`));\n    p.outro(pc.green(`Worktree metadata already looks healthy for ${target.label}.`));\n    return;\n  }\n\n  if (targetConfig && targetHasWorktreeEnv) {\n    await runWorktreeReseed({\n      fromConfig: source.configPath,\n      to: target.rootPath,","sourceCodeStart":4362,"sourceCodeEnd":4398,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L4362-L4398","documentation":"Self-repair guard in worktree repair: the resolved repair source config is the same file as the repair target's config, meaning the worktree would reseed from itself; the --from-config/--from-instance flags must point at a different source.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:3519 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use --from-config or --from-instance to point repair at a different source instance."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}