jackwener/OpenCLI · error · CommandExecutionError

SignOut svg not found

Error message

SignOut svg not found

What it means

The kimi sign-out command clicks an SVG named 'SignOut' on the Kimi /settings page via clickBySvgNameScript. If the in-page script cannot find that SVG (or its clickable ancestor), it returns {ok:false} with a reason, and the command throws CommandExecutionError with that reason or the fallback 'SignOut svg not found'.

Source

Thrown at clis/kimi/audit-extras.js:61

    browser: true,
    siteSession: 'persistent',
    navigateBefore: false,
    args: [
        { name: 'yes', type: 'boolean', default: false, help: 'Actually sign out (default: dry-run)' },
    ],
    columns: AUDIT_EXTRA_COLUMNS,
    func: async (page, kwargs) => {
        const yes = kwargs?.yes === true || kwargs?.yes === 'true' || kwargs?.yes === '1';
        if (!yes) {
            return [{ Status: 'dry-run — pass --yes to actually sign out' }];
        }
        const url = await page.evaluate('window.location.href');
        if (!String(url || '').includes('/settings')) {
            await page.goto(`${KIMI_URL}settings`);
            await page.wait(1.5);
        }
        const res = await page.evaluate(clickBySvgNameScript('SignOut'));
        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'SignOut svg not found', '');
        await page.wait(1);
        return [{ Status: 'signed-out' }];
    },
});

// -------- upgrade --------
cli({
    site: 'kimi',
    name: 'upgrade',
    access: 'write',
    description: 'Click the "Upgrade" button (or 升级会员) in the Kimi sidebar — opens the membership/upgrade page or dialog.',
    domain: KIMI_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    siteSession: 'persistent',
    navigateBefore: false,
    args: [],
    columns: AUDIT_EXTRA_COLUMNS,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check whether you are actually still signed in — if already signed out, the error is expected and no action is needed
  2. Increase the wait/retry: re-run the command so the settings page has more time to load
  3. Open kimi.com/settings in a browser and inspect whether an svg[name='SignOut'] still exists — if Kimi renamed it, update the selector in clickBySvgNameScript usage
  4. Verify the session cookie is valid and the page is not redirecting to a login URL

Example fix

// before
await page.wait(1.5);
const res = await page.evaluate(clickBySvgNameScript('SignOut'));
// after
await page.wait(3); // give SPA more time to render
let res = await page.evaluate(clickBySvgNameScript('SignOut'));
if (!res?.ok) { await page.wait(2); res = await page.evaluate(clickBySvgNameScript('SignOut')); }
Defensive patterns

Strategy: try-catch

Validate before calling

const url = await page.evaluate('window.location.href');
const hasSvg = await page.evaluate(`!!document.querySelector("svg[name='SignOut']")`);
if (!String(url).includes('/settings') || !hasSvg) throw new Error('SignOut unavailable: not on settings or already signed out');

Type guard

function isClickResult(res) { return res != null && typeof res === 'object' && typeof res.ok === 'boolean'; }

Try / catch

try {
  await runCli('kimi sign-out', { yes: true });
} catch (e) {
  if (/SignOut svg not found|signed out/i.test(e.message)) console.warn('Nothing to sign out of — ignoring');
  else throw e;
}

Prevention

When it happens

Trigger: Running `kimi sign-out --yes` when the SignOut svg does not exist in the /settings DOM: the account already signed out, Kimi renamed/redesigned the icon, the settings page failed to fully render within the 1.5s wait, or the page redirected away from /settings.

Common situations: Session already expired so the settings page shows a login screen instead; Kimi UI update changed svg name='SignOut'; slow network made the 1.5s page.wait insufficient; headless browser blocks rendering the sidebar.

Related errors


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