can1357/oh-my-pi · error · SessionResolutionError

--from-${source} requires session persistence

Error message

--from-${source} requires session persistence

What it means

Foreign session imports (--from-claude / --from-codex) create a session in the current project, which requires session persistence to be enabled. Passing --no-session alongside either flag throws this SessionResolutionError, since there would be nowhere to write the imported session.

Source

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

export class SessionResolutionError extends Error {
	readonly hint?: string;
	constructor(message: string, hint?: string) {
		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,

View on GitHub (pinned to 9690622007)

Solutions

  1. Remove --no-session from the command.
  2. If you truly need no persistence, browse the foreign tool's session files directly instead of importing (e.g. Claude's projects directory).

Example fix

// before
omp --from-codex --no-session
// after
omp --from-codex
Defensive patterns

Strategy: validation

Validate before calling

if ((process.argv.includes("--from-claude") || process.argv.includes("--from-codex")) && process.argv.includes("--no-session"))
  throw new Error("--from-* imports need session persistence; drop --no-session");

Prevention

When it happens

Trigger: Running e.g. `omp --from-claude --no-session` — resolveForeignSessionSource sees source set and parsed.noSession true.

Common situations: Habitual --no-session users (one-off throwaway runs) trying a foreign import; scripts that always append --no-session for CI runs.

Related errors


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