jackwener/OpenCLI · error · CommandExecutionError
LeftBar svg not visible
Error message
LeftBar svg not visible
What it means
The toggle-sidebar command injects a script that locates the SVG icon named 'LeftBar' on the Kimi page and clicks it. If the script reports failure (res.ok false), the command throws CommandExecutionError with the script's reason, defaulting to 'LeftBar svg not visible'. The library throws this because the DOM element needed to toggle the sidebar could not be found or is not visible/clickable.
Source
Thrown at clis/kimi/ui.js:84
});
// -------- sidebar-toggle --------
cli({
site: 'kimi',
name: 'sidebar-toggle',
access: 'write',
description: 'Click the LeftBar svg to toggle the Kimi sidebar.',
domain: KIMI_DOMAIN,
strategy: Strategy.COOKIE,
browser: true,
siteSession: 'persistent',
navigateBefore: false,
args: [],
columns: UI_COLUMNS,
func: async (page) => {
await ensureOnKimi(page);
const res = await page.evaluate(clickBySvgNameScript('LeftBar', { last: false }));
if (!res?.ok) throw new CommandExecutionError(res?.reason || 'LeftBar svg not visible', '');
return [{ Status: 'toggled' }];
},
});
// -------- view-all-history --------
cli({
site: 'kimi',
name: 'view-all-history',
access: 'write',
description: 'Navigate to /chat/history (full conversation list page).',
domain: KIMI_DOMAIN,
strategy: Strategy.COOKIE,
browser: true,
siteSession: 'persistent',
navigateBefore: false,
args: [],
columns: UI_COLUMNS,
func: async (page) => {View on GitHub (pinned to 49907e53dc)
Solutions
- Add a short wait or wait-for-selector after ensureOnKimi/page.goto before toggling so the icon has rendered.
- Verify you are on a Kimi page that actually renders the LeftBar icon (not a login or error page).
- Update the library if Kimi changed its icon names.
- Retry the command once — transient render timing is a common cause.
Example fix
// before
await page.evaluate(clickBySvgNameScript('LeftBar', { last: false }));
// after
await page.wait(1); // let the UI render
const res = await page.evaluate(clickBySvgNameScript('LeftBar', { last: false }));
if (!res?.ok) throw new Error(res?.reason); Defensive patterns
Strategy: retry
Validate before calling
// wait until the icon exists before toggling
await page.waitForSelector('svg[name="LeftBar"]'); Type guard
const isClickResult = (r) => !!r && typeof r === 'object' && r.ok === true;
Try / catch
try {
return await toggleSidebar(page);
} catch (e) {
if (/LeftBar svg not visible/.test(e.message)) {
await page.wait(1);
return await toggleSidebar(page);
}
throw e;
} Prevention
- Always wait for page render (wait-for-selector or short delay) before DOM interactions.
- Run against a window size where the sidebar toggle is present.
- Check for login/error pages before UI commands.
When it happens
Trigger: page.evaluate(clickBySvgNameScript('LeftBar')) returns { ok:false } — the LeftBar svg is absent, hidden (display:none/zero size), or inside a collapsed header at the time of the click.
Common situations: Kimi UI updated and renamed the icon; page not fully rendered yet (invoked right after navigation without waiting); browser window too narrow so the sidebar toggle is replaced by a different layout; already-on-kimi check passed but the page is an error/blank state.
Related errors
- Failed to click model option
- Kimi model switch did not verify the requested model: reques
- Model dropdown opened but no options detected.
- Midjourney Creation Action unavailable: ${target?.reason ||
- Visible Midjourney control "${label}" was not found
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/c9b239c4f71c000e.
Report an issue: GitHub.