jackwener/OpenCLI · warning · EmptyResultError

No projects matched "${kwargs.project}". Try without --proje

Error message

No projects matched "${kwargs.project}". Try without --project.

What it means

The history command aggregates recent projects and tasks scraped from the Trae SOLO project-list view; when a --project filter is applied and the resulting rows are empty, this EmptyResultError is thrown with a suggestion to retry without the filter. Without a filter, a different message fires indicating the view itself isn't showing projects.

Source

Thrown at clis/trae-solo/history.js:45

          project: headerText,
          tasks: taskRows.map((row) => (row.innerText || '').trim().split('\\n')[0] || '(untitled)'),
        });
      }
      return out;
    })()`);

        const filter = (kwargs.project || '').toLowerCase();
        const limit = Number.isInteger(kwargs.limit) && kwargs.limit > 0 ? kwargs.limit : 100;
        const rows = [];
        for (const p of projects || []) {
            if (filter && !p.project.toLowerCase().includes(filter)) continue;
            const tasks = p.tasks.slice(0, limit);
            for (let i = 0; i < tasks.length; i++) {
                rows.push({ Project: p.project, 'Task Index': i + 1, Task: tasks[i] });
            }
        }
        if (!rows.length) {
            throw new EmptyResultError(
                'trae-solo history',
                filter
                    ? `No projects matched "${kwargs.project}". Try without --project.`
                    : 'No projects visible. Make sure TRAE SOLO is on the project-list view and the sidebar is expanded.',
            );
        }
        return rows;
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-run without --project to see all visible project names, then copy the exact name
  2. Match the display name exactly as shown in Trae SOLO's sidebar (case/punctuation)
  3. Make sure Trae SOLO is on the project-list view with the sidebar expanded
  4. If the project is missing entirely, open it once in Trae SOLO so it appears in history

Example fix

// before
await traeSoloCli.history({ project: 'MyApp' }); // throws if none matched
// after
const all = await traeSoloCli.history({});
const row = all.find(r => r.Project.toLowerCase().includes('myapp'));
if (!row) throw new Error('project not visible in Trae');
const tasks = await traeSoloCli.history({ project: row.Project });
Defensive patterns

Strategy: validation

Validate before calling

const all = await traeSoloCli.history({}); // no filter
const match = all.find(r => r.Project === wanted);
if (!match) throw new Error(`"${wanted}" not in visible projects: ${[...new Set(all.map(r => r.Project))].join(', ')}`);

Type guard

function projectVisible(rows, name) {
  return rows.some(r => typeof r.Project === 'string' && r.Project === name);
}

Try / catch

try {
  rows = await traeSoloCli.history({ project: name });
} catch (e) {
  if (e instanceof EmptyResultError && /No projects matched/.test(e.message)) {
    console.error('Run history without --project to list exact names.');
  } else throw e;
}

Prevention

When it happens

Trigger: Calling history with --project <name> where no scraped project name matches the filter string (exact match against rendered titles).

Common situations: Typos or different casing in the project name; project not open/visible in Trae SOLO's project list; sidebar collapsed so projects aren't rendered; filter uses a path while the UI shows only the project display name.

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/c9a7ec92ca0ab8d8. Report an issue: GitHub.