{"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":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":858,"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":840,"sourceCodeEnd":876,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/worktree.ts#L840-L876","documentation":"Thrown by resolveWorktreeReseedSource when both a worktree selector (--from) and an explicit config source (--from-config/--from-data-dir/--from-instance) are supplied. The reseed source must be unambiguous, so mixing the two selection modes is rejected up front.","triggerScenarios":"Invoking a reseed/repair command with flags like `--from myworktree --from-config /path/config.json` simultaneously; a script or alias that always passes --from-config while the user also types --from.","commonSituations":"Copy-pasting flags from docs without removing the conflicting one; wrapper scripts that inject default --from-config; misunderstanding that --from is itself a source selector equivalent to the config flags.","solutions":["Use exactly one source mode: either `--from <worktree>` OR one of `--from-config`/`--from-data-dir`/`--from-instance`.","Audit wrapper scripts/aliases for injected --from-config that conflict with a typed --from.","Remove the redundant flag and re-run."],"exampleFix":"# before\npaperclipai worktree reseed --from feat-x --from-config ~/.paperclip/instances/default/config.json\n# after\npaperclipai worktree reseed --from feat-x","handlingStrategy":"validation","validationCode":"function assertSingleSourceMode(opts: { from?: string; fromConfig?: string; fromDataDir?: string; fromInstance?: string }): void {\n  const selector = nonEmpty(opts.from);\n  const explicit = nonEmpty(opts.fromConfig) || nonEmpty(opts.fromDataDir) || nonEmpty(opts.fromInstance);\n  if (selector && explicit) throw new Error('Pass only one source mode.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document the mutual exclusion of --from and --from-config* flags.","Audit wrapper scripts for injected default flags.","Add CLI-level flag-conflict parsing upstream of resolveWorktreeReseedSource."],"tags":["worktree","reseed","cli-flags","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}