jackwener/OpenCLI · error · CommandExecutionError

Kimi model switch did not verify the requested model: reques

Error message

Kimi model switch did not verify the requested model: requested "${wantSet}", current "${verified || 'not visible'}"

What it means

After clicking a model option, the command re-reads the visible model indicator (svg 'Down_b' neighbor text) and compares it (normalized) to the clicked label. If they differ — including when the indicator is not visible — it throws CommandExecutionError stating requested vs current model, with remediation guidance. This prevents reporting success when the switch silently didn't take effect.

Source

Thrown at clis/kimi/ui.js:300

            await page.wait(0.5);
            const verified = await page.evaluate(`(() => {
      ${IS_VISIBLE_JS}
      const svgs = Array.from(document.querySelectorAll('svg[name="Down_b"]')).filter(isVisible);
      for (const svg of svgs) {
        let p = svg.parentElement;
        for (let i = 0; i < 4 && p; i++) {
          const spans = p.querySelectorAll('span');
          for (const s of spans) {
            const t = (s.textContent || '').trim();
            if (/^K\\d|^Kimi |^Pro\\b|^Auto/.test(t)) return t;
          }
          p = p.parentElement;
        }
      }
      return '';
    })()`);
            if (normalizeModel(verified) !== normalizeModel(clickRes.clicked)) {
                throw new CommandExecutionError(
                    `Kimi model switch did not verify the requested model: requested "${wantSet}", current "${verified || 'not visible'}"`,
                    'Open the Kimi model menu and verify the requested model is selectable, then retry.',
                );
            }
            return [{ Index: 1, Model: clickRes.clicked, Active: 'switched' }];
        }

        try { await page.evaluate(`document.body.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));`); } catch {}
        if (!opts.length) {
            throw new EmptyResultError('kimi model', 'Model dropdown opened but no options detected.');
        }
        return opts.map((m, i) => ({ Index: i + 1, Model: m, Active: m === cur ? 'yes' : '' }));
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry the model set command and then verify via the model get/list command.
  2. Manually open the Kimi model menu and confirm the requested model is selectable, then retry (per the error hint).
  3. Re-login or reload the page if the UI is in a stale state.
  4. Update the library if the model-indicator markup changed.

Example fix

// before
await run('kimi', 'model', { set: 'Kimi K2' }); // may throw unverified
// after
try {
  await run('kimi', 'model', { set: 'Kimi K2' });
} catch (e) {
  await page.reload();
  await run('kimi', 'model', { set: 'Kimi K2' });
}
Defensive patterns

Strategy: try-catch

Type guard

const verified = (cur, clicked) => normalizeModel(cur) === normalizeModel(clicked);

Try / catch

try {
  await run('kimi', 'model', { set: want });
} catch (e) {
  if (/did not verify the requested model/.test(e.message)) {
    await page.reload();
    const cur = await run('kimi', 'model');
    if (!cur.some(m => m.Active === 'yes' && normalize(m.Model) === normalize(want))) {
      await run('kimi', 'model', { set: want });
    }
  } else throw e;
}

Prevention

When it happens

Trigger: normalizeModel(verified) !== normalizeModel(clickRes.clicked): the click didn't register, the menu reverted, the page shows the previous model, or the verified text is empty/not visible.

Common situations: Kimi rejected the selection (network hiccup); indicator re-rendered with a different label than the option text; the clicked option was a sub-menu header rather than a selectable model; UI update changed the Down_b icon structure.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/23290274fdc0e784. Report an issue: GitHub.