jackwener/OpenCLI · error · CommandExecutionError

${probe.detail}

Error message

${probe.detail}

What it means

When the WHOAMI_PROBE executed in the Quark page reports kind 'render-error', verifyQuarkIdentity throws this CommandExecutionError carrying the probe's detail string. It means the page rendered but the probe detected an on-page error state (e.g. an error UI or failed script) rather than a clean account/info response. This surfaces when the Quark web app fails to initialize properly in the automated browser.

Source

Thrown at clis/quark/auth.js:30

    const d = await r.json();
    const data = d && d.data;
    const isEmpty = !data || Array.isArray(data) || Object.keys(data).length === 0;
    if (isEmpty) return { kind: 'auth', detail: 'Quark account/info returned empty data — anonymous' };
    const nickname = String(data.nickname || data.nick_name || data.name || '');
    if (!nickname) return { kind: 'render-error', detail: 'Quark account/info populated but no nickname field — response shape drift' };
    return { ok: true, nickname };
  } catch (e) {
    return { kind: 'exception', detail: String(e && e.message || e) };
  }
})()`;

async function verifyQuarkIdentity(page) {
  await page.goto('https://pan.quark.cn/');
  await page.wait(2);
  const probe = await page.evaluate(WHOAMI_PROBE);
  if (probe?.kind === 'auth') throw new AuthRequiredError('quark.cn', probe.detail);
  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Quark account/info`);
  if (probe?.kind === 'render-error') throw new CommandExecutionError(probe.detail);
  if (probe?.kind === 'exception') throw new CommandExecutionError(`Quark whoami failed: ${probe.detail}`);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Quark probe: ${JSON.stringify(probe)}`);
  return { nickname: probe.nickname };
}

registerSiteAuthCommands({
  site: 'quark',
  domain: 'quark.cn',
  loginUrl: 'https://pan.quark.cn/',
  columns: ['nickname'],
  verify: verifyQuarkIdentity,
  poll: async (page) => {
    const probe = await page.evaluate(WHOAMI_PROBE);
    if (!probe?.ok) throw new AuthRequiredError('quark.cn', 'Waiting for Quark login');
    return { nickname: probe.nickname };
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Read probe.detail in the message to see the concrete render problem reported by the page.
  2. Re-run after increasing the wait (page.wait(2)) or retrying, since slow loads can produce transient render errors.
  3. Open pan.quark.cn manually in the automated browser to check for captcha/risk-control interstitials and resolve them or use a warmed session.
  4. Update the tool if Quark changed its UI, as the probe's render-error detection may be misfiring on new markup.
  5. Try a different/newer headless browser user-agent if the SPA refuses the current environment.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check: load the page and confirm a logged-in render marker exists before probing
await page.goto('https://pan.quark.cn/');
await page.wait(5);
if (await page.evaluate(() => !!document.querySelector('.login-btn, [class*=login]'))) {
  throw new Error('Quark page not in logged-in state');
}

Type guard

function isRenderErrorProbe(p) {
  return !!p && typeof p === 'object' && p.kind === 'render-error' && typeof p.detail === 'string';
}

Try / catch

try {
  await verifyQuarkIdentity(page);
} catch (e) {
  if (e instanceof CommandExecutionError && !String(e.message).startsWith('HTTP')) {
    // render error path: inspect page state, then retry once
  } else throw e;
}

Prevention

When it happens

Trigger: page.evaluate(WHOAMI_PROBE) returns {kind:'render-error', detail} while verifying quark identity — the DOM/error signal captured by the probe during page load of pan.quark.cn.

Common situations: Quark frontend update changing markup that the probe relies on; page loaded in an error/limit state (e.g. captcha or risk-control interstitial); slow network causing partial render; browser environment (old headless Chromium) unsupported by the Quark SPA.

Related errors


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