jackwener/OpenCLI · error · CommandExecutionError

HTTP ${probe.httpStatus} from Jimeng passport

Error message

HTTP ${probe.httpStatus} from Jimeng passport

What it means

When the in-page WHOAMI_PROBE's HTTP call to Jimeng passport completes with a non-OK HTTP status (kind 'http'), verifyJimengIdentity throws CommandExecutionError including the status. This means the identity check reached the passport server but got an error response, distinct from auth (401-style) or JS exceptions.

Source

Thrown at clis/jimeng/auth.js:29

  try {
    const r = await fetch('/passport/account/info/v2/?aid=513695', { credentials: 'include', headers: { Accept: 'application/json' } });
    if (r.status === 401 || r.status === 403) return { kind: 'auth', detail: 'Jimeng passport HTTP ' + r.status };
    if (!r.ok) return { kind: 'http', httpStatus: r.status };
    const d = await r.json();
    const u = d && d.data;
    if (!u || !u.user_id || u.is_visitor_account) return { kind: 'auth', detail: 'Jimeng passport returned a visitor account (anonymous)' };
    return { ok: true, user_id: String(u.user_id_str || u.user_id), screen_name: String(u.screen_name || u.name || '') };
  } catch (e) {
    return { kind: 'exception', detail: String(e && e.message || e) };
  }
})()`;

async function verifyJimengIdentity(page) {
  await page.goto('https://jimeng.jianying.com/ai-tool/generate?type=image&workspace=0');
  await page.wait(2);
  const probe = await page.evaluate(WHOAMI_PROBE);
  if (probe?.kind === 'auth') throw new AuthRequiredError('jimeng.jianying.com', probe.detail);
  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Jimeng passport`);
  if (probe?.kind === 'exception') throw new CommandExecutionError(`Jimeng whoami failed: ${probe.detail}`);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Jimeng probe: ${JSON.stringify(probe)}`);
  return { user_id: probe.user_id, screen_name: probe.screen_name };
}

registerSiteAuthCommands({
  site: 'jimeng',
  domain: 'jimeng.jianying.com',
  loginUrl: 'https://jimeng.jianying.com/',
  columns: ['user_id', 'screen_name'],
  verify: verifyJimengIdentity,
  poll: async (page) => {
    const probe = await page.evaluate(WHOAMI_PROBE);
    if (!probe?.ok) throw new AuthRequiredError('jimeng.jianying.com', 'Waiting for Jimeng login');
    return { user_id: probe.user_id, screen_name: probe.screen_name };
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check the reported HTTP status: 5xx → retry later; 429 → wait and reduce probe frequency; 403 → investigate anti-bot blocking
  2. Load jimeng.jianying.com manually in the attached Chrome and confirm normal browsing works
  3. Retry after a delay; the failure may be transient
  4. Disable proxies/VPN that could be blocked by Jimeng's edge
  5. If it persists, verify the passport endpoint URL used by WHOAMI_PROBE is still current

Example fix

// before
await verifyJimengIdentity(page);
// after
try {
  await verifyJimengIdentity(page);
} catch (err) {
  if (/HTTP \d+ from Jimeng passport/.test(err.message)) {
    await new Promise(r => setTimeout(r, 5000)); // transient passport error
    return verifyJimengIdentity(page);
  }
  throw err;
}
Defensive patterns

Strategy: retry

Type guard

function isJimengHttpStatusError(err) {
  return err instanceof CommandExecutionError && /HTTP \d+ from Jimeng passport/.test(err.message);
}

Try / catch

try {
  const identity = await verifyJimengIdentity(page);
} catch (err) {
  if (isJimengHttpStatusError(err) && /HTTP (429|5\d\d)/.test(err.message)) {
    await sleep(5000);
    return verifyJimengIdentity(page);
  }
  throw err;
}

Prevention

When it happens

Trigger: The probe's fetch to the Jimeng passport endpoint returns a status like 403 (WAF/bot block), 429 (rate limit), or 5xx, with httpStatus carried back to the page-level evaluate result.

Common situations: Jimeng passport under heavy load (5xx); automated access blocked by anti-bot measures (403); too-frequent probes (429); regional restrictions or network middleware altering responses.

Related errors


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