jackwener/OpenCLI · error · CommandExecutionError

Codex ${description} was not verified for ${conversationRefF

Error message

Codex ${description} was not verified for ${conversationRefForError(ref)}.

What it means

After performing a UI action (pin or archive), waitForConversationPostcondition polls the sidebar for up to its timeout, re-extracting projects and checking a predicate (e.g. conversation now pinned/archived). If the postcondition never holds, it throws this CommandExecutionError stating the action could not be verified for the referenced conversation.

Source

Thrown at clis/codex/_actions.js:240

            `${result.reason || 'Failed to perform action.'}${detail}`,
            'Make sure Codex Desktop is running and the target conversation is selectable.',
        );
    }
    return { ...result, selected };
}

export async function waitForConversationPostcondition(page, ref, predicate, description, timeoutMs = 4000) {
    const deadline = Date.now() + timeoutMs;
    let lastMatch = null;
    while (Date.now() < deadline) {
        const projects = await readConversationProjects(page);
        lastMatch = findCodexConversation(projects, ref);
        if (predicate(lastMatch)) {
            return lastMatch;
        }
        await page.wait(0.2);
    }
    throw new CommandExecutionError(
        `Codex ${description} was not verified for ${conversationRefForError(ref)}.`,
        'The UI action may have failed or the sidebar selectors may have drifted.',
    );
}

export async function setConversationPinned(page, kwargs, desiredPinned) {
    const selected = await resolveActionConversation(page, kwargs);
    if (selected.pinned === desiredPinned) {
        return { status: desiredPinned ? 'already-pinned' : 'already-unpinned', selected };
    }
    const action = await selectAndClickAction(page, kwargs, [desiredPinned ? 'Pin chat' : 'Unpin chat']);
    await waitForConversationPostcondition(
        page,
        action.selected,
        match => match?.conversation?.pinned === desiredPinned,
        desiredPinned ? 'pin' : 'unpin',
    );
    return { status: desiredPinned ? 'pinned' : 'unpinned', selected: action.selected };

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Increase the wait/timeout and retry the action
  2. Verify manually in the Codex UI whether the action actually took effect
  3. Refresh the sidebar/page and re-run the command
  4. Update opencli so its state-detection selectors match the current Codex UI

Example fix

// before
await archiveConversation(page, kwargs); // row disappears -> unverified
// after
try {
  await archiveConversation(page, kwargs);
} catch (e) {
  if (e.message.includes('was not verified')) {
    // treat as archived: row intentionally left the sidebar
  } else throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

const before = await readConversationProjects(page);
const target = findCodexConversation(before, ref);
if (!target || !target.conversation.threadId) {
  throw new Error('Target conversation not verifiable before action');
}

Type guard

function matchesPredicate(resolved, predicate) {
  return Boolean(resolved && predicate(resolved));
}

Try / catch

try {
  await setConversationPinned(page, kwargs, true);
} catch (e) {
  if (e instanceof CommandExecutionError && e.message.includes('was not verified')) {
    // verify manually or re-read sidebar state; the action may still have applied
    const projects = await readConversationProjects(page);
    const now = findCodexConversation(projects, kwargs);
    if (!now?.conversation.pinned) throw e;
  } else throw e;
}

Prevention

When it happens

Trigger: Calling setConversationPinned or archiveConversation when the click succeeded but the sidebar state never changed within the polling window: the action silently failed, the row left the sidebar (archive), or the state attribute selectors drifted.

Common situations: Slow Codex UI exceeding the poll timeout, archiving the last conversation in a project so the row disappears from extraction, Codex UI update changing pinned/archived markers.

Related errors


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