can1357/oh-my-pi · error · SessionResolutionError
Session "${sessionArg}" not found.
Error message
Session "${sessionArg}" not found. What it means
When --resume is given an identifier that is neither a path nor resolvable among recent sessions, resolveResumableSession returns no match and this SessionResolutionError is thrown with a hint to run `omp --resume` interactively or start a new session.
Source
Thrown at packages/coding-agent/src/main.ts:970
"Run `omp --resume` without an argument to pick from recent sessions, or `omp` to start a new one.",
);
}
return await SessionManager.forkFrom(match.session.path, cwd, parsed.sessionDir);
}
if (parsed.noSession) {
return SessionManager.inMemory();
}
normalizeContinueSessionArgs(parsed);
if (typeof parsed.resume === "string") {
const sessionArg = parsed.resume;
if (sessionArg.includes("/") || sessionArg.includes("\\") || sessionArg.endsWith(".jsonl")) {
return await SessionManager.open(sessionArg, parsed.sessionDir);
}
const match = await resolveResumableSession(sessionArg, cwd, parsed.sessionDir);
if (!match) {
throw new SessionResolutionError(
`Session "${sessionArg}" not found.`,
"Run `omp --resume` without an argument to pick from recent sessions, or `omp` to start a new one.",
);
}
if (match.scope === "local") {
const moveResult = await moveMissingCwdSessionIfNeeded(
sessionArg,
match.session,
cwd,
parsed.sessionDir,
askToMoveSession,
);
if (moveResult.status === "moved") {
return moveResult.manager;
}
if (moveResult.status === "declined") {
return undefined;
}View on GitHub (pinned to 9690622007)
Solutions
- Run `omp --resume` with no argument to pick interactively from recent sessions.
- Pass the session .jsonl file path directly (paths are opened via SessionManager.open without ID resolution).
- Run omp from the original project directory (or pass --session-dir) so the ID resolves in the right store.
- Start a new session with `omp` if the old one is gone.
Example fix
// before omp --resume my-session-x # never existed // after omp --resume # interactive picker, or: omp --resume ~/.omp/sessions/<project>/abc123.jsonl
Defensive patterns
Strategy: validation
Validate before calling
import * as fsSync from "node:fs";
const arg = "abc123";
if (!arg.includes("/") && !arg.endsWith(".jsonl")) {
// not a path: confirm it exists in the current project's session store before resuming
} Try / catch
try {
await resumeSession(arg);
} catch (err) {
if (err.message.endsWith("not found.")) {
// launch `omp --resume` interactively or fall back to a new session
}
} Prevention
- Resume from the same working directory where the session was created.
- Use `omp --resume` with no argument to discover valid IDs interactively.
- Check --session-dir matches the store the ID belongs to.
- Remember sessions started with --no-session can never be resumed.
When it happens
Trigger: `omp --resume <name>` where <name> matches no session in the current project's session store (and isn't a file path).
Common situations: Stale or mistyped session ID; resuming from a different working directory than where the session was created; custom --session-dir mismatch; sessions cleaned up by retention; using --no-session habitually so nothing was ever saved.
Related errors
- Session "${forkSource}" not found.
- Session "${sessionArg}" belongs to a directory that no longe
- Could not switch to resumed project ${resumedCwd} (${error i
- Unknown security scan: ${scanId}
- Unknown security operation: ${operationId}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/083c6eda0f668b18.
Report an issue: GitHub.