{"record":{"id":"d909421daa1d4123","repo":"jackwener/OpenCLI","slug":"http-probe-httpstatus-from-manus-api-auth-sess","errorCode":null,"errorMessage":"HTTP ${probe.httpStatus} from Manus /api/auth/session","messagePattern":"HTTP (.+?) from Manus /api/auth/session","errorType":"http","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/manus/auth.js","lineNumber":36,"sourceCode":"      if (r.status === 401 || r.status === 403) {\n        return { kind: 'auth', detail: 'Manus /api/auth/session HTTP ' + r.status };\n      }\n      if (r.status === 503) {\n        return { kind: 'http', httpStatus: 503 };\n      }\n      if (!r.ok) return { kind: 'http', httpStatus: r.status };\n      const d = await r.json();\n      const u = d?.user || d;\n      if (!u || !(u.id || u.userId)) {\n        return { kind: 'auth', detail: 'Manus /api/auth/session 200 but no user' };\n      }\n      return { ok: true, user_id: String(u.id || u.userId), name: String(u.name || u.displayName || '') };\n    } catch (e) {\n      return { kind: 'exception', detail: String(e && e.message || e) };\n    }\n  })()`);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('manus.im', probe.detail);\n  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Manus /api/auth/session`);\n  if (probe?.kind === 'exception') throw new CommandExecutionError(`Manus whoami failed: ${probe.detail}`);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Manus probe: ${JSON.stringify(probe)}`);\n  return { user_id: probe.user_id, name: probe.name };\n}\n\nregisterSiteAuthCommands({\n  site: 'manus',\n  domain: 'manus.im',\n  loginUrl: 'https://manus.im/login',\n  columns: ['user_id', 'name'],\n  verify: verifyManusIdentity,\n  poll: async (page) => {\n    if (!await hasManusSessionCookie(page)) {\n      throw new AuthRequiredError('manus.im', 'Waiting for Manus session cookies');\n    }\n    return verifyManusIdentity(page);\n  },\n});","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/manus/auth.js#L18-L54","documentation":"When the identity probe gets a non-OK, non-auth HTTP status from /api/auth/session (e.g. 500, 502, 504, 429), it returns kind:'http' and this line throws a CommandExecutionError reporting the status code. Unlike AuthRequiredError, this signals a server/network problem rather than missing credentials.","triggerScenarios":"Manus's /api/auth/session returns 5xx during outages or deployments, 429 under rate limiting, or any other non-2xx/non-401/non-403/non-503 status; occurs during manus whoami/auth verify or any command that calls verifyManusIdentity (including the login poll).","commonSituations":"Manus server incident or maintenance window; rate limiting from too-frequent CLI polling; corporate proxy/WAF intercepting requests; transient network errors between browser and manus.im.","solutions":["Wait a few minutes and retry — most 5xx are transient server-side outages.","Check Manus status/announcements for an ongoing incident.","If 429, back off and reduce polling frequency of auth checks.","Test https://manus.im in a normal browser to see if the site itself is up.","If behind a corporate proxy/firewall, verify it isn't intercepting or blocking manus.im API calls."],"exampleFix":"// before: tight poll loop trips rate limiting\nfor (;;) { await verifyManusIdentity(page); }\n// after: back off on HTTP errors\nfor (;;) {\n  try { return await verifyManusIdentity(page); }\n  catch (e) { if (!/HTTP \\d+ from Manus/.test(e.message)) throw e; await sleep(30000); }\n}","handlingStrategy":"retry","validationCode":"// pre-flight: is manus.im reachable?\nconst res = await fetch('https://manus.im/').catch(() => null);\nif (!res || !res.ok) throw new Error('manus.im unreachable — retry later');","typeGuard":"function isServerError(probe) { return probe?.kind === 'http' && probe.httpStatus >= 500; }","tryCatchPattern":"const retry = async (fn, n = 3) => {\n  for (let i = 0; i < n; i++) {\n    try { return await fn(); }\n    catch (e) {\n      if (/HTTP \\d+ from Manus \\/api\\/auth\\/session/.test(e.message) && i < n - 1) {\n        await new Promise(r => setTimeout(r, 5000 * (i + 1))); continue;\n      }\n      throw e;\n    }\n  }\n};","preventionTips":["Add exponential backoff for 5xx/429 responses instead of failing immediately.","Monitor Manus status pages and skip jobs during known incidents.","Rate-limit polling of auth endpoints to avoid 429s.","Check proxy/firewall configurations that might intercept manus.im traffic."],"tags":["http-5xx","server-error","network","manus","api-availability"],"backgroundTag":"http-5xx-server-error","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}