{"record":{"id":"24c6478527e7548d","repo":"jackwener/OpenCLI","slug":"kind-button-not-visible","errorCode":null,"errorMessage":"${kind} button not visible","messagePattern":"(.+?) button not visible","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/kimi/chat.js","lineNumber":401,"sourceCode":"    access: 'write',\n    description: 'Like or dislike the last assistant message. Pass --conv <id> to target a specific chat.',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'kind', positional: true, required: true, help: 'like or dislike' },\n        { name: 'conv', required: false, help: 'Chat id or URL' },\n    ],\n    columns: CHAT_COLUMNS,\n    func: async (page, kwargs) => {\n        const kind = String(kwargs?.kind || '').trim().toLowerCase();\n        if (kind !== 'like' && kind !== 'dislike') throw new ArgumentError('kind', 'must be \"like\" or \"dislike\"');\n        await maybeNavigateConv(page, kwargs?.conv);\n        const svgName = kind === 'like' ? 'Like' : 'Dislike';\n        const res = await page.evaluate(clickBySvgNameScript(svgName));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || `${kind} button not visible`, '');\n        return [{ Status: 'clicked', Reaction: kind }];\n    },\n});\n\n// -------- share --------\ncli({\n    site: 'kimi',\n    name: 'share',\n    access: 'write',\n    description: 'Click Share on the last assistant message (opens Kimi\\'s share dialog). Pass --conv <id> to target a specific chat.',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'conv', required: false, help: 'Chat id or URL' },\n    ],","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/chat.js#L383-L419","documentation":"This error is thrown by the kimi chat like/dislike CLI command when the in-page script that locates the Like or Dislike SVG icon on the Kimi conversation page reports it could not find/click the button. The CLI wraps the failure reason in CommandExecutionError, falling back to the message '<kind> button not visible' when the page script returned no specific reason.","triggerScenarios":"Calling `kimi chat like --kind like` (or dislike) after `maybeNavigateConv` when the current conversation page does not render the Like/Dislike SVG (clickBySvgNameScript returns ok:false), e.g. wrong conversation id/URL, the reaction buttons only appear after an assistant reply, or Kimi changed the SVG name.","commonSituations":"Navigating to a conversation with no assistant message yet (reaction icons not rendered), using an outdated selector name after a Kimi UI update, landing on the home page instead of a conversation because the conv argument was wrong, or the page not finished loading when the script runs.","solutions":["Verify the conv id/URL points to a real conversation that contains at least one assistant reply so the Like/Dislike icons are rendered","Wait for the page to fully load or retry the command once the conversation is visible","Inspect the conversation DOM to confirm the SVG name is still 'Like'/'Dislike'; update the svgName in clickBySvgNameScript if Kimi renamed them","Read res.reason from the error detail for the page's own explanation (e.g. 'svg not found') and act on it"],"exampleFix":"// before\nawait maybeNavigateConv(page, kwargs?.conv);\nconst res = await page.evaluate(clickBySvgNameScript(svgName));\n// after\nawait maybeNavigateConv(page, kwargs?.conv);\nawait page.wait(2); // let conversation UI render\nconst res = await page.evaluate(clickBySvgNameScript(svgName));\nif (!res?.ok && /svg not found/i.test(res?.reason || '')) {\n  // retry after UI settles or open a bug that the SVG name changed\n}","handlingStrategy":"try-catch","validationCode":"// ensure conversation has assistant replies before clicking\nconst turns = await kimi(['chat', 'read']);\nif (!turns.some(t => t.Role === 'Assistant')) throw new Error('no assistant reply to react to');","typeGuard":"const isClickResult = (r) => !!r && typeof r === 'object' && typeof r.ok === 'boolean';","tryCatchPattern":"try {\n  await kimi(['chat', 'like', '--kind', 'like']);\n} catch (e) {\n  if (/button not visible/.test(e.message)) {\n    await page.wait(2);\n    await kimi(['chat', 'like', '--kind', 'like']); // one retry after render\n  } else throw e;\n}","preventionTips":["Only react on conversations that already contain an assistant reply","Wait for page load before clicking SVG icons","Pin/verify SVG names after Kimi UI updates","Log res.reason to distinguish missing element from click failure"],"tags":["browser-automation","ui-selector","kimi"],"backgroundTag":"ui-element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}