{"record":{"id":"ed6d47a0b7599adb","repo":"paperclipai/paperclip","slug":"use-either-from-worktree-or-from-config-fr","errorCode":null,"errorMessage":"Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both.","messagePattern":"Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":874,"sourceCode":"  if (opts.sourceConfigPathOverride) return path.resolve(opts.sourceConfigPathOverride);\n  if (opts.fromConfig) return path.resolve(opts.fromConfig);\n  if (!opts.fromDataDir && !opts.fromInstance) {\n    return resolveConfigPath();\n  }\n  const sourceHome = path.resolve(expandHomePrefix(opts.fromDataDir ?? \"~/.paperclip\"));\n  const sourceInstanceId = sanitizeWorktreeInstanceId(opts.fromInstance ?? \"default\");\n  return path.resolve(sourceHome, \"instances\", sourceInstanceId, \"config.json\");\n}\n\nexport function resolveWorktreeReseedSource(input: WorktreeReseedOptions): ResolvedWorktreeReseedSource {\n  const fromSelector = nonEmpty(input.from);\n  const fromConfig = nonEmpty(input.fromConfig);\n  const fromDataDir = nonEmpty(input.fromDataDir);\n  const fromInstance = nonEmpty(input.fromInstance);\n  const hasExplicitConfigSource = Boolean(fromConfig || fromDataDir || fromInstance);\n\n  if (fromSelector && hasExplicitConfigSource) {\n    throw new Error(\n      \"Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both.\",\n    );\n  }\n\n  if (fromSelector) {\n    const endpoint = resolveWorktreeEndpointFromSelector(fromSelector, { allowCurrent: true });\n    return {\n      configPath: endpoint.configPath,\n      label: endpoint.label,\n    };\n  }\n\n  if (hasExplicitConfigSource) {\n    const configPath = resolveSourceConfigPath({\n      fromConfig: fromConfig ?? undefined,\n      fromDataDir: fromDataDir ?? undefined,\n      fromInstance: fromInstance ?? undefined,\n    });","sourceCodeStart":856,"sourceCodeEnd":892,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L856-L892","documentation":"Mutually-exclusive source-selection guard for reseed: the caller passed both a --from worktree selector and one of the config-based source flags (--from-config/--from-data-dir/--from-instance), which name two different kinds of reseed source.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:858 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both."],"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"}