jackwener/OpenCLI · warning · EmptyResultError
No chat-turn refs in ${repo}.
Error message
No chat-turn refs in ${repo}. What it means
This EmptyResultError is thrown by the task-fs turns listing command when the snapshot git repo exists but contains no refs at all (git for-each-ref refs/tags returned zero rows). It signals an initialized-but-unused snapshot repo rather than a missing one.
Source
Thrown at clis/trae-solo/task-fs.js:120
columns: ['Index', 'Task Id', 'Has Snapshot', 'Has Config', 'Modified', 'Phase', 'Turn Id', 'Commit'],
func: async (args) => {
const tid = String(args['task-id'] || '').trim();
if (!tid) throw new ArgumentError('task-id required');
const repo = snapshotRepoFor(tid);
if (!fs.existsSync(path.join(repo, '.git'))) {
throw new CommandExecutionError(`No snapshot repo for task ${tid}.`, `Tried: ${repo}`);
}
// List tags + their commits, sort by commit date.
const raw = gitInRepo(repo, ['for-each-ref', '--format=%(refname:short)|%(*objectname:short)|%(objectname:short)|%(committerdate:iso8601)', 'refs/tags']);
const rows = raw.split('\n').filter(Boolean).map((line) => {
const [tag, _ptr, oid, date] = line.split('|');
const m = tag.match(/^(before|after)-chat-turn-([0-9a-f]+)(?:-(refresh))?$/);
const phase = m ? (m[1] + (m[3] ? '/refresh' : '')) : 'misc';
const turnId = m ? m[2] : tag;
return { phase, turnId, oid, date };
}).sort((a, b) => a.date.localeCompare(b.date));
if (!rows.length) {
throw new EmptyResultError('trae-solo task-fs-turns', `No chat-turn refs in ${repo}.`);
}
const limit = Number.isInteger(args.limit) && args.limit > 0 ? args.limit : 50;
return rows.slice(0, limit).map((r, i) => ({
Index: i + 1,
'Task Id': '',
'Has Snapshot': '',
'Has Config': '',
Modified: '',
Phase: r.phase,
'Turn Id': r.turnId,
Commit: r.oid,
}));
},
});
// -------- task-fs-show --------
cli({
site: 'trae-solo',View on GitHub (pinned to 49907e53dc)
Solutions
- Run the Trae task so at least one chat turn completes and a snapshot tag is created, then retry
- Inspect tags directly with `git -C <repo> tag -l` to confirm the repo truly has no tags
- List all refs with `git -C <repo> for-each-ref` to see if snapshots were stored elsewhere
- If tags were accidentally deleted, restore them or re-run the affected turns to regenerate snapshots
Example fix
// before
if (!rows.length) {
throw new EmptyResultError('trae-solo task-fs-turns', `No chat-turn refs in ${repo}.`);
}
// after
if (!rows.length) {
const anyRefs = gitInRepo(repo, ['for-each-ref']).trim();
console.warn(`No tags in ${repo}; all refs: ${anyRefs || '(none)'}`);
throw new EmptyResultError('trae-solo task-fs-turns', `No chat-turn refs in ${repo}.`);
} Defensive patterns
Strategy: try-catch
Validate before calling
const tags = gitInRepo(repo, ['tag', '-l']).trim();
if (!tags) console.warn(`Snapshot repo ${repo} has no tags; turns listing will be empty`); Type guard
const hasTurnTags = (repo) => gitInRepo(repo, ['for-each-ref', 'refs/tags']).trim().length > 0;
Try / catch
try {
const turns = await runTaskFsTurns({ 'task-id': tid });
} catch (e) {
if (/No chat-turn refs/.test(e.message)) {
console.warn('No turn snapshots yet; run the task to completion first.');
return [];
}
throw e;
} Prevention
- Verify the task completed at least one chat turn before listing turns
- Check `git tag -l` in the snapshot repo to confirm snapshot tags exist
- Keep snapshot producer and CLI versions aligned so tag naming matches
- Do not manually delete tags from snapshot repos
When it happens
Trigger: Calling the turns listing command for a task whose snapshot repo exists (has .git) but has no tags — i.e., the repo was initialized but no before-/after-chat-turn snapshots were ever tagged; also fires when every existing tag fails the tag-name regex so rows.length is 0.
Common situations: Task created but the chat never advanced a turn, so no turn snapshots were captured; snapshot repo reset with tags deleted; snapshots stored on branches instead of tags after a schema change.
Related errors
- No after-chat-turn tags found.
- "${modulePath}" has no semver-shaped tags on proxy.golang.or
- No tag matched turn "${t}".
- No prices returned for train_no=${trainNo} ${fromStation.nam
- No 12306 stations match "${keyword}"
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/b7af432892a7dc8c.
Report an issue: GitHub.