{"record":{"id":"4f49253cf19a5e8d","repo":"jackwener/OpenCLI","slug":"no-codex-conversations-were-visible-open-the-code","errorCode":null,"errorMessage":"No Codex conversations were visible. Open the Codex sidebar and retry.","messagePattern":"No Codex conversations were visible\\. Open the Codex sidebar and retry\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/codex/history.js","lineNumber":21,"sourceCode":"import { flattenCodexProjects, readCodexProjects } from './sidebar.js';\nexport const historyCommand = cli({\n    site: 'codex',\n    name: 'history',\n    access: 'read',\n    description: 'List visible Codex conversation threads grouped by project',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'project', required: false, help: 'Filter by project label or path' },\n        { name: 'limit', required: false, help: 'Max conversations per project' },\n    ],\n    columns: ['Project', 'Index', 'Title', 'Updated', 'Active'],\n    func: async (page, kwargs) => {\n        const projects = await readCodexProjects(page);\n        const rows = flattenCodexProjects(projects, kwargs);\n        if (rows.length === 0) {\n            throw new EmptyResultError('codex history', kwargs.project\n                ? `No Codex conversations were visible for project \"${kwargs.project}\".`\n                : 'No Codex conversations were visible. Open the Codex sidebar and retry.');\n        }\n        return rows;\n    },\n});\n","sourceCodeStart":3,"sourceCodeEnd":28,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/codex/history.js#L3-L28","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Open the Codex sidebar in the automated browser and wait for conversations to render, then retry `opencli codex history`.","If using `--project`, run without the flag first to list actual project names, then retry with an exact match.","Wait/retry if Codex was just launched — the sidebar loads asynchronously.","If conversations are clearly visible but the error persists, the sidebar selectors likely broke in a Codex update; update opencli."],"exampleFix":"// before\nopencli codex history --project \"my-proj\"\n// after\nopencli codex history                      # discover real project names\nopencli codex history --project \"my-proj\"  # exact name from the listing","handlingStrategy":"validation","validationCode":"// confirm project name exists before filtering\nconst all = await run('opencli codex history');\nconst rows = parseTable(all);\nif (kwargs.project && !rows.some(r => r.Project === kwargs.project)) {\n  throw new Error(`Unknown project: ${kwargs.project}`);\n}","typeGuard":"function hasSidebarRows(page) {\n  return page.evaluate(`document.querySelectorAll('[role=\"navigation\"] a, [class*=\"conversation\"], [class*=\"thread\"]').length > 0`);\n}","tryCatchPattern":"try {\n  const rows = await codexHistory({ project });\n} catch (err) {\n  if (err instanceof EmptyResultError && !project) {\n    // sidebar empty/unopened — prompt user to open the Codex sidebar\n  } else if (err instanceof EmptyResultError) {\n    // project filter matched nothing — retry without filter\n  } else throw err;\n}","preventionTips":["Open the Codex sidebar and let it load before querying history","Discover project names with an unfiltered history call before using --project","Retry shortly after launching Codex while the sidebar hydrates","Keep opencli current with Codex sidebar DOM changes"],"tags":["empty-result","ui-scraping","codex","sidebar"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}