{"record":{"id":"53173f48f0db0c71","repo":"jackwener/OpenCLI","slug":"no-after-chat-turn-tags-found","errorCode":null,"errorMessage":"No after-chat-turn tags found.","messagePattern":"No after-chat-turn tags found\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/task-fs.js","lineNumber":170,"sourceCode":"        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        let ref;\n        if (args.turn) {\n            const t = String(args.turn).trim();\n            // Prefer after-* if present; else before-*.\n            const tagListRaw = gitInRepo(repo, ['for-each-ref', '--format=%(refname:short)', 'refs/tags']);\n            const tags = tagListRaw.split('\\n').filter((x) => x.includes(t));\n            ref = tags.find((x) => x.startsWith('after-chat-turn-')) || tags[0];\n            if (!ref) throw new CommandExecutionError(`No tag matched turn \"${t}\".`, '');\n        } else {\n            // Pick the latest after-chat-turn ref.\n            const raw = gitInRepo(repo, ['for-each-ref', '--sort=-committerdate', '--format=%(refname:short)', 'refs/tags']);\n            ref = raw.split('\\n').find((t) => t.startsWith('after-chat-turn-'));\n            if (!ref) throw new CommandExecutionError('No after-chat-turn tags found.', '');\n        }\n        const tree = gitInRepo(repo, ['ls-tree', '-r', '-l', ref]);\n        const rows = tree.split('\\n').filter(Boolean).map((line) => {\n            const parts = line.split(/\\s+/);\n            // mode  type  oid  size  path\n            return { mode: parts[0], oid: parts[2], size: parts[3], pth: parts.slice(4).join(' ') };\n        });\n        const limit = Number.isInteger(args.limit) && args.limit > 0 ? args.limit : 50;\n        return rows.slice(0, limit).map((r) => ({ Mode: r.mode, Path: r.pth, Size: r.size }));\n    },\n});\n","sourceCodeStart":152,"sourceCodeEnd":182,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/task-fs.js#L152-L182","documentation":"This CommandExecutionError is thrown by the task-fs files command when no `turn` argument was supplied and the repo contains no tags starting with `after-chat-turn-`. The command sorts tags by committerdate and takes the newest matching ref; with zero matches it cannot proceed.","triggerScenarios":"Calling the task-fs files command without --turn on a snapshot repo that has only before-chat-turn-* tags (a turn started but never completed), or a repo with no tags at all, or tags created with a different naming convention.","commonSituations":"A turn failed mid-way so only the before snapshot exists; querying a task that never completed a chat turn; a version change in snapshot tag naming (snapshot tool no longer uses the after-chat-turn- prefix).","solutions":["Pass an explicit --turn <id> to pick a before-chat-turn tag instead of relying on the latest-after default","Check `git -C <repo> tag -l` to see what tags exist and use one via --turn","Re-run the Trae task to completion so an after-chat-turn snapshot is captured","If tag naming changed in a newer version, align the CLI and snapshot producer versions"],"exampleFix":"// before\nlet ref = raw.split('\\n').find((t) => t.startsWith('after-chat-turn-'));\nif (!ref) throw new CommandExecutionError('No after-chat-turn tags found.', '');\n// after\nlet ref = raw.split('\\n').find((t) => t.startsWith('after-chat-turn-'))\n       || raw.split('\\n').find((t) => t.startsWith('before-chat-turn-')); // fallback\nif (!ref) throw new CommandExecutionError('No chat-turn tags found.', '');","handlingStrategy":"fallback","validationCode":"const tags = gitInRepo(repo, ['for-each-ref', '--format=%(refname:short)', 'refs/tags']).split('\\n').filter(Boolean);\nif (!tags.some((t) => t.startsWith('after-chat-turn-'))) {\n    console.warn('No after-chat-turn tags; specify --turn to use a before-* tag.');\n}","typeGuard":null,"tryCatchPattern":"try {\n    const rows = await runTaskFsFiles({ 'task-id': tid });\n} catch (e) {\n    if (/No after-chat-turn tags found/.test(e.message)) {\n        // fall back to an explicit before-chat-turn tag\n        return runTaskFsFiles({ 'task-id': tid, turn: latestBeforeTurnId(repo) });\n    }\n    throw e;\n}","preventionTips":["Prefer passing an explicit --turn id over relying on the latest-after default","Check that the task actually completed turns before querying files","Verify tag naming conventions after Trae or snapshot tool upgrades","Do not skip the after-turn snapshot capture step"],"tags":["git","tags","empty-result"],"backgroundTag":"tag-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}