{"record":{"id":"083c6eda0f668b18","repo":"can1357/oh-my-pi","slug":"session-sessionarg-not-found-083c6e","errorCode":null,"errorMessage":"Session \"${sessionArg}\" not found.","messagePattern":"Session \"(.+?)\" not found\\.","errorType":"exception","errorClass":"SessionResolutionError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/main.ts","lineNumber":970,"sourceCode":"\t\t\t\t\"Run `omp --resume` without an argument to pick from recent sessions, or `omp` to start a new one.\",\n\t\t\t);\n\t\t}\n\t\treturn await SessionManager.forkFrom(match.session.path, cwd, parsed.sessionDir);\n\t}\n\n\tif (parsed.noSession) {\n\t\treturn SessionManager.inMemory();\n\t}\n\tnormalizeContinueSessionArgs(parsed);\n\n\tif (typeof parsed.resume === \"string\") {\n\t\tconst sessionArg = parsed.resume;\n\t\tif (sessionArg.includes(\"/\") || sessionArg.includes(\"\\\\\") || sessionArg.endsWith(\".jsonl\")) {\n\t\t\treturn await SessionManager.open(sessionArg, parsed.sessionDir);\n\t\t}\n\t\tconst match = await resolveResumableSession(sessionArg, cwd, parsed.sessionDir);\n\t\tif (!match) {\n\t\t\tthrow new SessionResolutionError(\n\t\t\t\t`Session \"${sessionArg}\" not found.`,\n\t\t\t\t\"Run `omp --resume` without an argument to pick from recent sessions, or `omp` to start a new one.\",\n\t\t\t);\n\t\t}\n\t\tif (match.scope === \"local\") {\n\t\t\tconst moveResult = await moveMissingCwdSessionIfNeeded(\n\t\t\t\tsessionArg,\n\t\t\t\tmatch.session,\n\t\t\t\tcwd,\n\t\t\t\tparsed.sessionDir,\n\t\t\t\taskToMoveSession,\n\t\t\t);\n\t\t\tif (moveResult.status === \"moved\") {\n\t\t\t\treturn moveResult.manager;\n\t\t\t}\n\t\t\tif (moveResult.status === \"declined\") {\n\t\t\t\treturn undefined;\n\t\t\t}","sourceCodeStart":952,"sourceCodeEnd":988,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/main.ts#L952-L988","documentation":"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.","triggerScenarios":"`omp --resume <name>` where <name> matches no session in the current project's session store (and isn't a file path).","commonSituations":"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.","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."],"exampleFix":"// before\nomp --resume my-session-x   # never existed\n// after\nomp --resume   # interactive picker, or:\nomp --resume ~/.omp/sessions/<project>/abc123.jsonl","handlingStrategy":"validation","validationCode":"import * as fsSync from \"node:fs\";\nconst arg = \"abc123\";\nif (!arg.includes(\"/\") && !arg.endsWith(\".jsonl\")) {\n  // not a path: confirm it exists in the current project's session store before resuming\n}","typeGuard":null,"tryCatchPattern":"try {\n  await resumeSession(arg);\n} catch (err) {\n  if (err.message.endsWith(\"not found.\")) {\n    // launch `omp --resume` interactively or fall back to a new session\n  }\n}","preventionTips":["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."],"tags":["cli","session-resolution","not-found"],"backgroundTag":"session-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}