{"record":{"id":"0af654b9d288caea","repo":"jackwener/OpenCLI","slug":"share-button-not-visible","errorCode":null,"errorMessage":"Share button not visible","messagePattern":"Share button not visible","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/kimi/chat.js","lineNumber":424,"sourceCode":"// -------- 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    ],\n    columns: CHAT_COLUMNS,\n    func: async (page, kwargs) => {\n        await maybeNavigateConv(page, kwargs?.conv);\n        const res = await page.evaluate(clickBySvgNameScript('Share_a'));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Share button not visible', '');\n        await page.wait(1);\n        return [{ Status: 'share dialog opened' }];\n    },\n});\n\n// -------- ask --------\ncli({\n    site: 'kimi',\n    name: 'ask',\n    access: 'write',\n    description: 'Send a message and wait up to --timeout seconds for the assistant reply (best-effort: polls for turn count to grow + stabilize).',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'text', positional: true, required: true, help: 'Prompt text' },","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/chat.js#L406-L442","documentation":"Thrown by the kimi chat share command when page.evaluate(clickBySvgNameScript('Share_a')) fails to find or click the Share icon on the conversation page. Like the like/dislike handler, the CLI surfaces the page-side reason or the fallback 'Share button not visible'.","triggerScenarios":"Running the share command on a page where the 'Share_a' SVG is absent: not on a saved/shared conversation, the share icon is behind an overflow menu, the conv URL is wrong, or the page hasn't finished rendering.","commonSituations":"Attempting to share a fresh conversation where Kimi only shows Share after the conversation is saved, a Kimi UI update renaming the Share SVG, or navigation landed on the wrong page.","solutions":["Confirm the conversation URL is valid and the Share icon is visible in the browser before running the command","Wait/retry after page load so the icon is rendered","Check the DOM for the current Share SVG name and update the 'Share_a' argument if Kimi changed it","Inspect res.reason in the error for the precise page-side failure"],"exampleFix":"// before\nconst res = await page.evaluate(clickBySvgNameScript('Share_a'));\nif (!res?.ok) throw new CommandExecutionError(res?.reason || 'Share button not visible', '');\n// after\nawait page.wait(2); // ensure conversation UI is rendered\nconst res = await page.evaluate(clickBySvgNameScript('Share_a'));\nif (!res?.ok) {\n  // fall back to opening overflow menu if Kimi moved Share behind '...'\n  const retry = await page.evaluate(clickBySvgNameScript('Share'));\n  if (!retry?.ok) throw new CommandExecutionError(retry?.reason || res.reason, '');\n}","handlingStrategy":"try-catch","validationCode":"// confirm you are on a conversation URL that supports share\nif (!/kimi\\.com.*conversation|chat/.test(page.url())) throw new Error('not on a shareable conversation page');","typeGuard":"const isClickResult = (r) => !!r && typeof r === 'object' && typeof r.ok === 'boolean';","tryCatchPattern":"try {\n  await kimi(['chat', 'share']);\n} catch (e) {\n  if (/Share button not visible/.test(e.message)) {\n    await page.wait(2);\n    // retry or fall back to copying the conversation URL directly\n    return page.url();\n  }\n  throw e;\n}","preventionTips":["Verify the Share icon is rendered in the browser before automating","Allow render time (page.wait) after navigation","Re-check the Share SVG name after Kimi UI changes","Fall back to the conversation URL when the dialog is not essential"],"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"}