jackwener/OpenCLI · error · CommandExecutionError
Codex picker did not open after typing the command.
Error message
Codex picker did not open after typing the command.
What it means
After typing the composer text, the library expects typing to open the Codex picker (a list of [data-list-navigation-item] elements). If the script finds no visible picker options, it throws CommandExecutionError because --pick cannot proceed without a picker.
Source
Thrown at clis/codex/send.js:156
const wait = (ms) => new Promise((r) => setTimeout(r, ms));
let items = [];
for (let attempt = 0; attempt < 20; attempt += 1) {
items = Array.from(document.querySelectorAll('${PICKER_ITEM_SELECTOR}'))
.filter((it) => it instanceof HTMLElement && it.offsetParent);
if (items.length) break;
await wait(75);
}
// Picker titles are split into per-character spans for match
// highlighting, so read the leading truncate div for the title and the
// concatenated textContent (title plus description) for substrings.
return items.map((el) => {
const text = (el.textContent || '').replace(/\\s+/g, ' ').trim();
const lead = el.querySelector('[class*="truncate"]');
return { title: lead ? (lead.textContent || '').replace(/\\s+/g, ' ').trim() : text, text };
});
})()`));
if (!Array.isArray(options) || options.length === 0) {
throw new CommandExecutionError('Codex picker did not open after typing the command.', 'Check that the text opens a picker, or drop --pick.');
}
picked = findUniquePickerOption(options, pick);
if (!picked) {
throw new CommandExecutionError('No picker option matched.', `wanted=${pick} available=${JSON.stringify(options.map((option) => option.title))}`);
}
const clicked = unwrapEvaluateResult(await page.evaluate(`(() => {
const items = Array.from(document.querySelectorAll('${PICKER_ITEM_SELECTOR}'))
.filter((it) => it instanceof HTMLElement && it.offsetParent);
const target = items[${picked.index}];
if (!target) return false;
const rect = target.getBoundingClientRect();
const init = {
bubbles: true, cancelable: true, button: 0, buttons: 1,
clientX: Math.round(rect.left + rect.width / 2),
clientY: Math.round(rect.top + rect.height / 2),
};
// The picker only responds to the full pointer chain, and deferring it
// keeps the eval response ahead of the re-render that closes the picker.View on GitHub (pinned to 49907e53dc)
Solutions
- Drop --pick if your text doesn't open a picker (the error detail explicitly suggests this).
- Use text that actually triggers the picker, e.g. a leading '/' command, and verify manually in the browser.
- Check whether a Codex UI update changed the picker markup and update the CLI accordingly.
- Retry — if the page was slow, the picker may simply not have rendered in time.
Example fix
// before $ codex send --pick "plan" "hello" // CommandExecutionError: Codex picker did not open after typing the command. // after $ codex send --pick "Plan mode" "/plan hello" # text that opens a picker # or drop --pick: $ codex send "hello"
Defensive patterns
Strategy: fallback
Validate before calling
// Only pass --pick when the composer text actually triggers a picker
const opensPicker = /^(\/|@|#)/.test(text);
if (pick && !opensPicker) console.warn('--pick ignored: text does not open a picker'); Try / catch
try {
await codexSend({ text, pick });
} catch (e) {
if (e instanceof CommandExecutionError && /picker did not open/.test(e.message)) {
return codexSend({ text: textWithoutPickerPrefix }); // retry without --pick
}
throw e;
} Prevention
- Only use --pick with composer text known to open a picker (e.g. '/' commands).
- Verify picker behavior manually in the browser after Codex UI updates.
- Add a small wait/retry for slow pages before collecting picker options.
When it happens
Trigger: Using --pick with composer text that does not trigger any picker in the current Codex UI, or the picker failed to render/open before the options-collection script ran.
Common situations: Passing plain text that opens no picker (only specific prefixes like '/' or '@' open menus); Codex UI change renaming the data-list-navigation-item attribute; very slow page where the picker hadn't rendered yet; picker closed by an early Enter/blur.
Related errors
- Failed to fill rename input.
- Picker option "${rawLabel}" is ambiguous.
- No picker option matched.
- No Codex projects matched "${kwargs.project}". / No Codex pr
- --pick label cannot be empty
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e07d85184d8edf27.
Report an issue: GitHub.