jackwener/OpenCLI · info · AuthRequiredError

Waiting for Manus session cookies

Error message

Waiting for Manus session cookies

What it means

This AuthRequiredError is thrown by the poll callback that runs repeatedly while the user completes the browser login flow at manus.im/login. Until a recognized session cookie (auth_session, manus_token, _session, or session) with a non-empty value exists for the manus.im domain, the poller treats the user as still logged out and keeps waiting.

Source

Thrown at clis/manus/auth.js:50

      return { kind: 'exception', detail: String(e && e.message || e) };
    }
  })()`);
  if (probe?.kind === 'auth') throw new AuthRequiredError('manus.im', probe.detail);
  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Manus /api/auth/session`);
  if (probe?.kind === 'exception') throw new CommandExecutionError(`Manus whoami failed: ${probe.detail}`);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Manus probe: ${JSON.stringify(probe)}`);
  return { user_id: probe.user_id, name: probe.name };
}

registerSiteAuthCommands({
  site: 'manus',
  domain: 'manus.im',
  loginUrl: 'https://manus.im/login',
  columns: ['user_id', 'name'],
  verify: verifyManusIdentity,
  poll: async (page) => {
    if (!await hasManusSessionCookie(page)) {
      throw new AuthRequiredError('manus.im', 'Waiting for Manus session cookies');
    }
    return verifyManusIdentity(page);
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Complete the login in the opened browser window at https://manus.im/login and let the poller continue
  2. Verify manus.im cookies are not blocked (check browser privacy/extension settings) and retry
  3. Manually confirm you can see your account on manus.im in the automation browser, then rerun the command
  4. If Manus changed its cookie name, update the regex in hasManusSessionCookie in clis/manus/auth.js

Example fix

// before (narrow cookie-name match fails if Manus renames its cookie)
return cookies.some(c => /^(auth_session|manus_token|_session|session)$/.test(c.name) && c.value);
// after (broader match as a fallback)
return cookies.some(c => /^(auth_session|manus_token|_session|session|manus-session.*|.*session.*token)$/i.test(c.name) && c.value);
Defensive patterns

Strategy: retry

Validate before calling

const cookies = await page.getCookies({ url: 'https://manus.im' });
const hasSession = cookies.some(c => /^(auth_session|manus_token|_session|session)$/.test(c.name) && c.value);
if (!hasSession) await openLoginPageAndAwaitLogin('https://manus.im/login');

Type guard

function hasManusSession(cookies) {
  return Array.isArray(cookies) && cookies.some(
    c => typeof c?.name === 'string' && /^(auth_session|manus_token|_session|session)$/.test(c.name) && !!c.value
  );
}

Try / catch

try {
  const identity = await pollAuth(page);
} catch (e) {
  if (e instanceof AuthRequiredError && /Waiting for Manus session cookies/.test(e.message)) {
    await promptUserToCompleteLogin('https://manus.im/login');
    return pollAuth(page); // retry after the user signs in
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling any manus auth/whoami command before completing login: the browser session at manus.im has no session cookie yet — either the user hasn't signed in, the login page hasn't finished setting cookies, or existing cookies were cleared or expired.

Common situations: First-time setup before logging in; the login flow was interrupted or the tab closed before sign-in completed; corporate SSO redirect loops; cookies blocked by browser settings or extensions; Manus renamed its session cookie so the regex no longer matches.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/11c3ac1d21f86a7a. Report an issue: GitHub.