can1357/oh-my-pi · error · SessionResolutionError

--from-${source} cannot be combined with --continue, --resum

Error message

--from-${source} cannot be combined with --continue, --resume, or --fork

What it means

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.

Source

Thrown at packages/coding-agent/src/main.ts:681

		super(message);
		this.name = "SessionResolutionError";
		this.hint = hint;
	}
}

function resolveForeignSessionSource(
	parsed: Pick<Args, "continue" | "fork" | "fromClaude" | "fromCodex" | "noSession" | "resume">,
): ForeignSessionSource | undefined {
	if (parsed.fromClaude && parsed.fromCodex) {
		throw new SessionResolutionError("--from-claude and --from-codex cannot be used together");
	}
	const source = parsed.fromClaude ? "claude" : parsed.fromCodex ? "codex" : undefined;
	if (!source) return undefined;
	if (parsed.noSession) {
		throw new SessionResolutionError(`--from-${source} requires session persistence`);
	}
	if (parsed.continue || parsed.resume || parsed.fork) {
		throw new SessionResolutionError(`--from-${source} cannot be combined with --continue, --resume, or --fork`);
	}
	return source;
}

function isForeignSessionImport(parsed: Pick<Args, "fromClaude" | "fromCodex">): boolean {
	return parsed.fromClaude === true || parsed.fromCodex === true;
}

type MissingCwdMoveResult =
	| { status: "not-needed" }
	| { status: "declined" }
	| { status: "moved"; manager: SessionManager };

async function moveMissingCwdSessionIfNeeded(
	sessionArg: string,
	session: SessionInfo,
	cwd: string,
	sessionDir: string | undefined,

View on GitHub (pinned to 9690622007)

Solutions

  1. Drop --continue/--resume/--fork when importing; run the import first, then resume normally.
  2. If the goal is to continue a Claude/Codex conversation, pick it via `omp --resume` after importing once.

Example fix

// before
omp --from-claude --continue
// after
omp --from-claude   # then: omp --continue
Defensive patterns

Strategy: validation

Validate before calling

const hasImport = process.argv.some(a => a === "--from-claude" || a === "--from-codex");
const hasSelector = process.argv.some(a => ["--continue","--resume","--fork"].some(f => a === f || a.startsWith(f + "=")));
if (hasImport && hasSelector) throw new Error("Import and session selection are separate steps");

Prevention

When it happens

Trigger: Running e.g. `omp --from-claude --resume` or `omp --from-codex --fork <id>` — both an import source and a local session selector were requested.

Common situations: Users trying to continue an imported conversation in one command; muscle memory of always resuming with --continue; scripts templating --resume into every invocation.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/6c7cd635a38b89eb. Report an issue: GitHub.