{"record":{"id":"7b4b8f0637c1b750","repo":"jackwener/OpenCLI","slug":"kimi-history-rename-was-not-verified-for-chat-id","errorCode":null,"errorMessage":"Kimi history rename was not verified for chat ${id}","messagePattern":"Kimi history rename was not verified for chat (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/kimi/audit-extras.js","lineNumber":261,"sourceCode":"      const inputs = Array.from(document.querySelectorAll('input[type=\"text\"], input:not([type])')).filter(isVisible);\n      const input = inputs[inputs.length - 1];\n      if (!input) return { ok: false, reason: 'No input mounted after clicking Edit.' };\n      const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;\n      setter.call(input, ${JSON.stringify(newTitle)});\n      input.dispatchEvent(new Event('input', { bubbles: true }));\n      input.dispatchEvent(new Event('change', { bubbles: true }));\n      input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));\n      return { ok: true };\n    })()`);\n        if (!fillRes?.ok) throw new CommandExecutionError(fillRes?.reason || 'Rename input fill failed', '');\n        await page.wait(1);\n        const verified = await page.evaluate(`(() => {\n      const row = Array.from(document.querySelectorAll('a[href*=\"/chat/' + ${JSON.stringify(id)} + '\"]'))\n        .find((el) => (el.innerText || el.textContent || '').includes(${JSON.stringify(newTitle)}));\n      return !!row;\n    })()`);\n        if (!verified) {\n            throw new CommandExecutionError(\n                `Kimi history rename was not verified for chat ${id}`,\n                'The edit input was submitted, but the history row did not show the requested title.',\n            );\n        }\n        return [{ Status: 'renamed', ChatId: id, NewTitle: newTitle }];\n    },\n});\n","sourceCodeStart":243,"sourceCodeEnd":269,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/audit-extras.js#L243-L269","documentation":"Kimi's history rename command submits the new title via the edit input, then verifies inside the page that a sidebar history row for the chat id now contains the new title text. If the DOM check fails, it throws CommandExecutionError because the rename could not be confirmed. The library refuses to report success without visual confirmation in the history list.","triggerScenarios":"Calling the kimi history rename command with a chat id whose sidebar row either did not re-render with the new title yet, or the row selector `a[href*=\"/chat/<id>\"]` did not match, within the verification evaluate.","commonSituations":"Kimi UI lag: the edit submitted but React has not repainted the sidebar row when verification runs; the chat is not pinned/visible in the current history list so the row is absent from the DOM; a Kimi frontend update changed the history row markup; the new title contains characters the app normalizes differently.","solutions":["Retry the rename once after a short wait so the sidebar has time to re-render with the new title","Verify manually in the Kimi sidebar that the rename actually took effect (it may have succeeded after the check ran)","Ensure the target chat appears in the visible history list (open it once or scroll the sidebar) before renaming","Check for a Kimi frontend markup change and update the row selector in audit-extras.js if the site changed"],"exampleFix":"// before\nconst verified = await page.evaluate(...);\nif (!verified) throw new CommandExecutionError(...);\n// after\nlet verified = await page.evaluate(...);\nfor (let i = 0; i < 5 && !verified; i++) {\n  await page.wait(1);\n  verified = await page.evaluate(...);\n}\nif (!verified) throw new CommandExecutionError(`Kimi history rename was not verified for chat ${id}`, '...');","handlingStrategy":"retry","validationCode":"// verify sidebar row shows new title before trusting success\nconst rows = await page.evaluate(`Array.from(document.querySelectorAll('a[href*=\"/chat/${id}\"]')).map(a => a.innerText)`);\nif (!rows.some(t => t.includes(newTitle))) console.warn('rename not yet visible');","typeGuard":"function isRenameVerified(row, id, newTitle) {\n  return typeof row?.id === 'string' && row.id === id &&\n    typeof row?.title === 'string' && row.title.includes(newTitle);\n}","tryCatchPattern":"try {\n  await kimiHistoryRename({ id, title: newTitle });\n} catch (e) {\n  if (e.message.includes('not verified')) {\n    await sleep(2000);\n    await kimiHistoryRename({ id, title: newTitle }); // retry once\n  } else throw e;\n}","preventionTips":["Wait a moment between submitting the edit and verifying the sidebar","Ensure the target chat is visible in the history list before renaming","Pin the chat or open it once so its row exists in the DOM"],"tags":["kimi","ui-verification","rename","timeout"],"backgroundTag":"dom-verification-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}