{"record":{"id":"dbe1cf597875e03e","repo":"can1357/oh-my-pi","slug":"from-claude-and-from-codex-cannot-be-used-toge","errorCode":null,"errorMessage":"--from-claude and --from-codex cannot be used together","messagePattern":"--from-claude and --from-codex cannot be used together","errorType":"exception","errorClass":"SessionResolutionError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/main.ts","lineNumber":673,"sourceCode":" * session-resolution flags (`--resume`/`--fork`/missing-directory move prompts)\n * cannot be satisfied. {@link runRootCommand} catches it and prints a clean\n * stderr message instead of letting it surface as `[Uncaught Exception]`\n * (see issue #2084).\n */\nexport class SessionResolutionError extends Error {\n\treadonly hint?: string;\n\tconstructor(message: string, hint?: string) {\n\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\" }","sourceCodeStart":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/main.ts#L655-L691","documentation":"resolveForeignSessionSource validates CLI flag combinations for importing sessions from foreign tools. --from-claude (import Claude Code sessions) and --from-codex (import Codex sessions) are mutually exclusive source selectors, so passing both throws a SessionResolutionError before any session resolution happens.","triggerScenarios":"Invoking omp with both --from-claude and --from-codex on the same command line (or both present in a parsed args object passed to resolveForeignSessionSource).","commonSituations":"Aliased shell functions that append a default --from-* flag while the user supplies the other; scripted invocation building flags from two config sources; misunderstanding that both imports would be merged.","solutions":["Keep only one of --from-claude or --from-codex in the command.","Check shell aliases/functions for a hardcoded --from-* flag that duplicates your explicit one."],"exampleFix":"// before\nomp --from-claude --from-codex\n// after\nomp --from-claude","handlingStrategy":"validation","validationCode":"const flags = process.argv.slice(2);\nif (flags.includes(\"--from-claude\") && flags.includes(\"--from-codex\"))\n  throw new Error(\"Pick one import source: --from-claude OR --from-codex\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit shell aliases/functions for hardcoded --from-* flags.","Build import commands from a single config source to avoid duplicate flags.","Remember: one import source per invocation; chain invocations if you need both."],"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"}