{"record":{"id":"b7af432892a7dc8c","repo":"jackwener/OpenCLI","slug":"no-chat-turn-refs-in-repo","errorCode":null,"errorMessage":"No chat-turn refs in ${repo}.","messagePattern":"No chat-turn refs in (.+?)\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/trae-solo/task-fs.js","lineNumber":120,"sourceCode":"    columns: ['Index', 'Task Id', 'Has Snapshot', 'Has Config', 'Modified', 'Phase', 'Turn Id', 'Commit'],\n    func: async (args) => {\n        const tid = String(args['task-id'] || '').trim();\n        if (!tid) throw new ArgumentError('task-id required');\n        const repo = snapshotRepoFor(tid);\n        if (!fs.existsSync(path.join(repo, '.git'))) {\n            throw new CommandExecutionError(`No snapshot repo for task ${tid}.`, `Tried: ${repo}`);\n        }\n        // List tags + their commits, sort by commit date.\n        const raw = gitInRepo(repo, ['for-each-ref', '--format=%(refname:short)|%(*objectname:short)|%(objectname:short)|%(committerdate:iso8601)', 'refs/tags']);\n        const rows = raw.split('\\n').filter(Boolean).map((line) => {\n            const [tag, _ptr, oid, date] = line.split('|');\n            const m = tag.match(/^(before|after)-chat-turn-([0-9a-f]+)(?:-(refresh))?$/);\n            const phase = m ? (m[1] + (m[3] ? '/refresh' : '')) : 'misc';\n            const turnId = m ? m[2] : tag;\n            return { phase, turnId, oid, date };\n        }).sort((a, b) => a.date.localeCompare(b.date));\n        if (!rows.length) {\n            throw new EmptyResultError('trae-solo task-fs-turns', `No chat-turn refs in ${repo}.`);\n        }\n        const limit = Number.isInteger(args.limit) && args.limit > 0 ? args.limit : 50;\n        return rows.slice(0, limit).map((r, i) => ({\n            Index: i + 1,\n            'Task Id': '',\n            'Has Snapshot': '',\n            'Has Config': '',\n            Modified: '',\n            Phase: r.phase,\n            'Turn Id': r.turnId,\n            Commit: r.oid,\n        }));\n    },\n});\n\n// -------- task-fs-show --------\ncli({\n    site: 'trae-solo',","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/task-fs.js#L102-L138","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nif (!rows.length) {\n    throw new EmptyResultError('trae-solo task-fs-turns', `No chat-turn refs in ${repo}.`);\n}\n// after\nif (!rows.length) {\n    const anyRefs = gitInRepo(repo, ['for-each-ref']).trim();\n    console.warn(`No tags in ${repo}; all refs: ${anyRefs || '(none)'}`);\n    throw new EmptyResultError('trae-solo task-fs-turns', `No chat-turn refs in ${repo}.`);\n}","handlingStrategy":"try-catch","validationCode":"const tags = gitInRepo(repo, ['tag', '-l']).trim();\nif (!tags) console.warn(`Snapshot repo ${repo} has no tags; turns listing will be empty`);","typeGuard":"const hasTurnTags = (repo) => gitInRepo(repo, ['for-each-ref', 'refs/tags']).trim().length > 0;","tryCatchPattern":"try {\n    const turns = await runTaskFsTurns({ 'task-id': tid });\n} catch (e) {\n    if (/No chat-turn refs/.test(e.message)) {\n        console.warn('No turn snapshots yet; run the task to completion first.');\n        return [];\n    }\n    throw e;\n}","preventionTips":["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"],"tags":["git","empty-result","tags"],"backgroundTag":"no-git-refs-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}