{"record":{"id":"534fce193d28c136","repo":"jackwener/OpenCLI","slug":"session-not-found-uid","errorCode":null,"errorMessage":"Session not found: ${uid}","messagePattern":"Session not found: (.+?)","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/manus/read.js","lineNumber":49,"sourceCode":"    func: async (page, kwargs) => {\n        const uid = String(kwargs?.uid || '').trim();\n        if (!uid) throw new ArgumentError('uid', 'must be a non-empty session UID');\n\n        await ensureOnManus(page);\n\n        const data = requireObject(await page.evaluate(`(async () => {\n            ${MANUS_API_CALL_JS}\n            return callManusAPI('session.v1.SessionService/ListSessions', {\n                page: 1,\n                pageSize: 100,\n            });\n        })()`), 'read session');\n\n        const sessions = requireArray(data.sessions, 'read session');\n        const session = sessions.find((s) => s.uid === uid);\n\n        if (!session) {\n            throw new EmptyResultError('manus read', `Session not found: ${uid}`);\n        }\n\n        return [\n            { Field: 'UID', Value: session.uid || '—' },\n            { Field: 'Title', Value: session.title || '—' },\n            { Field: 'Status', Value: session.status || '—' },\n            { Field: 'Mode', Value: session.agentTaskMode ?? '—' },\n            { Field: 'Credits', Value: session.costedCredits ?? 0 },\n            { Field: 'Created', Value: formatTime(session.createdAt) },\n            { Field: 'Updated', Value: formatTime(session.updatedAt) },\n            { Field: 'Last Display Message', Value: session.lastDisplayMessage || '—' },\n        ];\n    },\n});\n","sourceCodeStart":31,"sourceCodeEnd":64,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/manus/read.js#L31-L64","documentation":"The `manus read` command calls `session.v1.SessionService/ListSessions` (first page, pageSize 100) and then searches the returned array for a session whose `uid` matches the argument. If no session matches, it throws this EmptyResultError rather than returning empty output. It is a lookup miss, not an API failure — the request succeeded but the target session was not in the returned list.","triggerScenarios":"Passing a uid that does not exist, was deleted/archived so it no longer appears in ListSessions, is not owned by the currently authenticated account, or is a typo; also when the session exists but falls beyond page 1's 100 sessions and the helper only queries the first page.","commonSituations":"Re-reading a session from a stale reference after it was deleted; running on a browser profile logged into a different Manus account than the one that created the session; truncated or mangled uid copied from a URL; account with >100 sessions.","solutions":["Run `manus list` and confirm the exact uid you meant; copy it verbatim.","Verify the browser profile the CLI uses is authenticated as the account that owns the session (re-login if needed).","Check the session wasn't deleted or archived in the Manus UI.","If the account has more than 100 sessions, the first-page ListSessions lookup may miss it — use the session directly from `manus list` output or reduce the count."],"exampleFix":"// before (guessed/stale uid)\n$ manus read sess_OLD123\n// EmptyResultError: Session not found: sess_OLD123\n\n// after (uid taken from list output)\n$ manus list\n$ manus read sess_01J8ZK3M9A","handlingStrategy":"try-catch","validationCode":"const sessions = JSON.parse(run('manus list --json'));\nif (!sessions.some(s => s.uid === targetUid)) {\n  throw new Error(`Unknown session uid: ${targetUid} — run 'manus list' for valid uids`);\n}","typeGuard":"const isKnownSession = (uid, sessions) => Array.isArray(sessions) && sessions.some(s => s && s.uid === uid);","tryCatchPattern":"try {\n  const rows = await run('manus read', uid);\n} catch (e) {\n  if (e instanceof EmptyResultError) {\n    console.error(`Session ${uid} not found; fetch a valid uid via 'manus list'.`);\n  } else throw e;\n}","preventionTips":["Always source uids from fresh `manus list` output instead of stale references.","Copy uids verbatim — beware truncation or whitespace when copying from URLs/terminals.","Confirm the CLI's browser profile is authenticated as the account that owns the session.","Remember deleted/archived sessions won't appear in ListSessions."],"tags":["empty-result","lookup-miss","not-found","cli"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}