{"record":{"id":"3f6ae7c5c18c1de8","repo":"jackwener/OpenCLI","slug":"no-close-svg-visible-no-banner-to-dismiss","errorCode":null,"errorMessage":"No Close svg visible — no banner to dismiss?","messagePattern":"No Close svg visible — no banner to dismiss\\?","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/kimi/audit-extras.js","lineNumber":122,"sourceCode":"\n// -------- dismiss-banner --------\ncli({\n    site: 'kimi',\n    name: 'dismiss-banner',\n    access: 'write',\n    description: 'Close any visible sidebar banner (e.g., \"Make a Review & Earn Credit\", \"获取应用程序\") by clicking its Close svg.',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [],\n    columns: AUDIT_EXTRA_COLUMNS,\n    func: async (page) => {\n        await ensureOnKimi(page);\n        const res = await page.evaluate(clickBySvgNameScript('Close', { last: false }));\n        if (!res?.ok) {\n            throw new EmptyResultError('kimi dismiss-banner', 'No Close svg visible — no banner to dismiss?');\n        }\n        return [{ Status: 'dismissed' }];\n    },\n});\n\n// -------- templates --------\ncli({\n    site: 'kimi',\n    name: 'templates',\n    access: 'read',\n    description: 'List template cards visible on a Kimi mode page (PPT/docs/deep-research/agent). Each mode shows curated example projects organized by category. Pass --mode to navigate first.',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'mode', required: false, help: 'Navigate to mode first: ppt|docs|deep-research|agent|websites|sheets|agent-swarm|code' },","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/audit-extras.js#L104-L140","documentation":"The kimi dismiss-banner command clicks the first visible SVG named 'Close' to dismiss a sidebar banner. If no Close svg is visible, clickBySvgNameScript returns {ok:false} and the command throws EmptyResultError with the explanatory message 'No Close svg visible — no banner to dismiss?'. This is a soft/informational failure: it usually just means there is nothing to dismiss.","triggerScenarios":"Running `kimi dismiss-banner` when no banner is currently shown: the banner was already dismissed (possibly persisted per-account), no promotional banner exists for this account, the banner renders after the evaluate runs, or Kimi changed the Close svg name.","commonSituations":"Calling dismiss-banner as part of a cleanup script on a fresh account with no banner; re-running after a previous successful dismissal; slow hydration so the banner svg hasn't mounted yet.","solutions":["Treat as benign: if no banner is present the goal is already achieved — catch EmptyResultError and continue","Retry once after a short wait in case the banner mounts late","Check in the browser whether a banner is actually visible; if yes but the svg name differs, update the clickBySvgNameScript target","Make the command idempotent in your script: skip dismiss-banner when a previous run already reported 'dismissed'"],"exampleFix":"// before\nawait runCli('kimi dismiss-banner');\n// after\ntry { await runCli('kimi dismiss-banner'); } catch (e) { if (e.name === 'EmptyResultError') console.log('No banner — nothing to do'); else throw e; }","handlingStrategy":"try-catch","validationCode":"const hasClose = await page.evaluate(`!!document.querySelector(\"svg[name='Close']\")`);\nif (!hasClose) return { skipped: true, reason: 'no banner present' };","typeGuard":"function isClickResult(res) { return res != null && typeof res === 'object' && typeof res.ok === 'boolean'; }","tryCatchPattern":"try {\n  await runCli('kimi dismiss-banner');\n} catch (e) {\n  if (e.name === 'EmptyResultError' || /no banner/i.test(e.message)) return; // nothing to dismiss = success\n  throw e;\n}","preventionTips":["Treat dismiss-banner as best-effort/idempotent in automation","Track previously dismissed banners to skip redundant calls","Retry once after a wait if the banner mounts late","Verify the Close svg name still matches after Kimi UI changes"],"tags":["browser-automation","dom-selector","idempotency"],"backgroundTag":"dom-element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}