jackwener/OpenCLI · warning · EmptyResultError

No Codex conversations were visible. Open the Codex sidebar

Error message

No Codex conversations were visible. Open the Codex sidebar and retry.

What it means

The `codex history` command reads the Codex sidebar via `readCodexProjects`, flattens the projects/conversations into rows, and throws this EmptyResultError when zero rows survive. The message tells the user the sidebar produced no visible conversations — either the sidebar isn't open/rendered or the optional `--project` filter matched nothing.

Source

Thrown at clis/codex/history.js:21

import { flattenCodexProjects, readCodexProjects } from './sidebar.js';
export const historyCommand = cli({
    site: 'codex',
    name: 'history',
    access: 'read',
    description: 'List visible Codex conversation threads grouped by project',
    domain: 'localhost',
    strategy: Strategy.UI,
    browser: true,
    args: [
        { name: 'project', required: false, help: 'Filter by project label or path' },
        { name: 'limit', required: false, help: 'Max conversations per project' },
    ],
    columns: ['Project', 'Index', 'Title', 'Updated', 'Active'],
    func: async (page, kwargs) => {
        const projects = await readCodexProjects(page);
        const rows = flattenCodexProjects(projects, kwargs);
        if (rows.length === 0) {
            throw new EmptyResultError('codex history', kwargs.project
                ? `No Codex conversations were visible for project "${kwargs.project}".`
                : 'No Codex conversations were visible. Open the Codex sidebar and retry.');
        }
        return rows;
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open the Codex sidebar in the automated browser and wait for conversations to render, then retry `opencli codex history`.
  2. If using `--project`, run without the flag first to list actual project names, then retry with an exact match.
  3. Wait/retry if Codex was just launched — the sidebar loads asynchronously.
  4. If conversations are clearly visible but the error persists, the sidebar selectors likely broke in a Codex update; update opencli.

Example fix

// before
opencli codex history --project "my-proj"
// after
opencli codex history                      # discover real project names
opencli codex history --project "my-proj"  # exact name from the listing
Defensive patterns

Strategy: validation

Validate before calling

// confirm project name exists before filtering
const all = await run('opencli codex history');
const rows = parseTable(all);
if (kwargs.project && !rows.some(r => r.Project === kwargs.project)) {
  throw new Error(`Unknown project: ${kwargs.project}`);
}

Type guard

function hasSidebarRows(page) {
  return page.evaluate(`document.querySelectorAll('[role="navigation"] a, [class*="conversation"], [class*="thread"]').length > 0`);
}

Try / catch

try {
  const rows = await codexHistory({ project });
} catch (err) {
  if (err instanceof EmptyResultError && !project) {
    // sidebar empty/unopened — prompt user to open the Codex sidebar
  } else if (err instanceof EmptyResultError) {
    // project filter matched nothing — retry without filter
  } else throw err;
}

Prevention

When it happens

Trigger: Running `opencli codex history` when `readCodexProjects(page)` returns nothing (sidebar collapsed, never loaded, or its DOM changed), or when `--project <name>` filters out every conversation (typo or wrong project name).

Common situations: Running history before opening the Codex sidebar in the automated browser; a fresh Codex install with no conversations; sidebar still loading and queried too early; passing a project name that doesn't exactly match a sidebar project.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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