{"record":{"id":"6c7cd635a38b89eb","repo":"can1357/oh-my-pi","slug":"from-source-cannot-be-combined-with-continu","errorCode":null,"errorMessage":"--from-${source} cannot be combined with --continue, --resume, or --fork","messagePattern":"--from-(.+?) cannot be combined with --continue, --resume, or --fork","errorType":"exception","errorClass":"SessionResolutionError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/main.ts","lineNumber":681,"sourceCode":"\t\tsuper(message);\n\t\tthis.name = \"SessionResolutionError\";\n\t\tthis.hint = hint;\n\t}\n}\n\nfunction resolveForeignSessionSource(\n\tparsed: Pick<Args, \"continue\" | \"fork\" | \"fromClaude\" | \"fromCodex\" | \"noSession\" | \"resume\">,\n): ForeignSessionSource | undefined {\n\tif (parsed.fromClaude && parsed.fromCodex) {\n\t\tthrow new SessionResolutionError(\"--from-claude and --from-codex cannot be used together\");\n\t}\n\tconst source = parsed.fromClaude ? \"claude\" : parsed.fromCodex ? \"codex\" : undefined;\n\tif (!source) return undefined;\n\tif (parsed.noSession) {\n\t\tthrow new SessionResolutionError(`--from-${source} requires session persistence`);\n\t}\n\tif (parsed.continue || parsed.resume || parsed.fork) {\n\t\tthrow new SessionResolutionError(`--from-${source} cannot be combined with --continue, --resume, or --fork`);\n\t}\n\treturn source;\n}\n\nfunction isForeignSessionImport(parsed: Pick<Args, \"fromClaude\" | \"fromCodex\">): boolean {\n\treturn parsed.fromClaude === true || parsed.fromCodex === true;\n}\n\ntype MissingCwdMoveResult =\n\t| { status: \"not-needed\" }\n\t| { status: \"declined\" }\n\t| { status: \"moved\"; manager: SessionManager };\n\nasync function moveMissingCwdSessionIfNeeded(\n\tsessionArg: string,\n\tsession: SessionInfo,\n\tcwd: string,\n\tsessionDir: string | undefined,","sourceCodeStart":663,"sourceCodeEnd":699,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/main.ts#L663-L699","documentation":"A foreign session import selects a fresh session source and therefore cannot be combined with the session-selection flags --continue, --resume, or --fork. resolveForeignSessionSource throws when any of those is present together with --from-claude/--from-codex.","triggerScenarios":"Running e.g. `omp --from-claude --resume` or `omp --from-codex --fork <id>` — both an import source and a local session selector were requested.","commonSituations":"Users trying to continue an imported conversation in one command; muscle memory of always resuming with --continue; scripts templating --resume into every invocation.","solutions":["Drop --continue/--resume/--fork when importing; run the import first, then resume normally.","If the goal is to continue a Claude/Codex conversation, pick it via `omp --resume` after importing once."],"exampleFix":"// before\nomp --from-claude --continue\n// after\nomp --from-claude   # then: omp --continue","handlingStrategy":"validation","validationCode":"const hasImport = process.argv.some(a => a === \"--from-claude\" || a === \"--from-codex\");\nconst hasSelector = process.argv.some(a => [\"--continue\",\"--resume\",\"--fork\"].some(f => a === f || a.startsWith(f + \"=\")));\nif (hasImport && hasSelector) throw new Error(\"Import and session selection are separate steps\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the import as its own command; resume/fork in a follow-up invocation.","Avoid templating --continue/--resume into every launch script.","Remember imports create a NEW session — there is nothing to continue in the same run."],"tags":["cli","flag-conflict","session-import"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}