{"record":{"id":"2d8dac5a59ce2fe7","repo":"jackwener/OpenCLI","slug":"copy-button-not-visible","errorCode":null,"errorMessage":"Copy button not visible","messagePattern":"Copy button not visible","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"warning","filePath":"clis/kimi/chat.js","lineNumber":346,"sourceCode":"    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'conv', required: false, help: 'Chat id or URL (navigates there before reading)' },\n        { name: 'click-button', type: 'boolean', default: false, help: 'Also click in-UI Copy button (writes to clipboard)' },\n    ],\n    columns: CHAT_COLUMNS,\n    func: async (page, kwargs) => {\n        await maybeNavigateConv(page, kwargs?.conv);\n        const turns = await readKimiTurns(page);\n        const assistantTurns = turns.filter((t) => t.role === 'Assistant');\n        if (!assistantTurns.length) {\n            throw new EmptyResultError('kimi copy-message', 'No assistant message visible.');\n        }\n        const last = assistantTurns[assistantTurns.length - 1];\n        if (kwargs?.['click-button'] === true || kwargs?.['click-button'] === 'true') {\n            const clickRes = await page.evaluate(clickBySvgNameScript('Copy'));\n            if (!clickRes?.ok) throw new CommandExecutionError(clickRes?.reason || 'Copy button not visible', '');\n        }\n        return [\n            { Field: 'Length', Value: String((last.text || '').length) + ' chars' },\n            { Field: 'ClipboardClicked', Value: (kwargs?.['click-button'] === true || kwargs?.['click-button'] === 'true') ? 'yes' : 'no' },\n            { Field: 'Text', Value: last.text || '' },\n        ];\n    },\n});\n\n// -------- regenerate --------\ncli({\n    site: 'kimi',\n    name: 'regenerate',\n    access: 'write',\n    description: 'Click Refresh (Kimi\\'s regenerate button) on the last assistant message. Pass --conv <id> to target a specific chat.',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/chat.js#L328-L364","documentation":"When copy-message runs with click-button=true, it invokes clickBySvgNameScript('Copy') on the last assistant turn; if the in-page script cannot find/click a Copy button, CommandExecutionError is thrown. The message (or clickRes.reason) indicates the copy control was not present or not clickable at that moment.","triggerScenarios":"Copy button only renders on hover/focus of the assistant message; kwargs['click-button'] is truthy but no response is hovered; Kimi renamed the Copy SVG icon or moved it behind an overflow menu.","commonSituations":"Headless automation where hover-dependent buttons never appear; Kimi UI updates relocating the copy action; calling click-button on a still-streaming response whose action bar hasn't rendered.","solutions":["Omit click-button and just read the returned Text field — the command already returns the full assistant message, so DOM copy is usually unnecessary.","Hover/focus the last assistant message before clicking (e.g. move mouse to the turn) so the Copy button renders.","Wait until the response finishes streaming, then retry.","Update the SVG name ('Copy') if the Kimi UI changed the icon."],"exampleFix":"// before\nawait cli('kimi', 'copy-message', { 'click-button': true });\n// after\nconst out = await cli('kimi', 'copy-message'); // no DOM click needed\nconst text = out.find(r => r.Field === 'Text').Value;","handlingStrategy":"fallback","validationCode":null,"typeGuard":"function clickOk(res) { return !!res && res.ok === true; }","tryCatchPattern":"try {\n  return await cli('kimi', 'copy-message', { 'click-button': true });\n} catch (e) {\n  if (/Copy button not visible/i.test(e.message)) {\n    // DOM copy unavailable; use returned text instead\n    return await cli('kimi', 'copy-message');\n  }\n  throw e;\n}","preventionTips":["Prefer the command's returned Text over DOM clipboard clicking.","Avoid click-button in headless sessions where hover UI doesn't render.","Wait for streaming to complete before requesting the copy action.","Re-verify the Copy icon name when Kimi updates its UI."],"tags":["dom-scraping","command-execution","kimi"],"backgroundTag":"button-click-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}