{"record":{"id":"fc9f797d562bbfa5","repo":"can1357/oh-my-pi","slug":"session-forksource-not-found","errorCode":null,"errorMessage":"Session \"${forkSource}\" not found.","messagePattern":"Session \"(.+?)\" not found\\.","errorType":"exception","errorClass":"SessionResolutionError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/main.ts","lineNumber":950,"sourceCode":"\n/** Resolves CLI session flags into an existing, forked, in-memory, or cancelled session manager. */\nexport async function createSessionManager(\n\tparsed: Args,\n\tcwd: string,\n\tactiveSettings: Settings = settings,\n\taskToMoveSession: SessionPrompt = promptMoveSession,\n): Promise<SessionManager | undefined> {\n\tif (parsed.fork) {\n\t\tif (parsed.noSession) {\n\t\t\tthrow new SessionResolutionError(\"--fork requires session persistence\");\n\t\t}\n\t\tconst forkSource = parsed.fork;\n\t\tif (forkSource.includes(\"/\") || forkSource.includes(\"\\\\\") || forkSource.endsWith(\".jsonl\")) {\n\t\t\treturn await SessionManager.forkFrom(forkSource, cwd, parsed.sessionDir);\n\t\t}\n\t\tconst match = await resolveResumableSession(forkSource, cwd, parsed.sessionDir);\n\t\tif (!match) {\n\t\t\tthrow new SessionResolutionError(\n\t\t\t\t`Session \"${forkSource}\" 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\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);","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/main.ts#L932-L968","documentation":"When --fork is given a session identifier that is neither a path (contains / or \\ or ends with .jsonl) nor resolvable among recent sessions, resolveResumableSession returns no match and this SessionResolutionError is thrown, with a hint pointing at `omp --resume`.","triggerScenarios":"`omp --fork <name>` where <name> doesn't match any resumable session for the current cwd/sessionDir (typo, stale ID, session from another project without --session-dir).","commonSituations":"Typo or truncated session ID; session created in a different project directory; using a custom --session-dir but passing an ID from the default dir (or vice versa); session file deleted by cleanup.","solutions":["Run `omp --resume` without an argument to browse recent sessions and copy the correct identifier.","Pass the session's full .jsonl path instead of the short ID.","If the session lives in another project, add --session-dir pointing there."],"exampleFix":"// before\nomp --fork abc12   # typo\n// after\nomp --fork abc123   # full id from `omp --resume` list","handlingStrategy":"validation","validationCode":"import * as fsSync from \"node:fs\";\nconst id = \"abc123\";\nconst asPath = id.includes(\"/\") || id.endsWith(\".jsonl\") ? id : null;\n// pre-check by listing sessions dir or running `omp --resume` picker first","typeGuard":null,"tryCatchPattern":"try {\n  await forkSession(id);\n} catch (err) {\n  if (err.message.endsWith(\"not found.\")) {\n    // surface `omp --resume` picker or full path hint to the user\n  }\n}","preventionTips":["Copy session IDs directly from `omp --resume` output rather than retyping them.","Use the full .jsonl path when the session is outside the current project.","Pass --session-dir when resuming sessions from a non-default store."],"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"}