{"record":{"id":"f54880084ab0696a","repo":"jackwener/OpenCLI","slug":"task-id-required","errorCode":null,"errorMessage":"task-id required","messagePattern":"task-id required","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/task-fs.js","lineNumber":105,"sourceCode":"});\n\n// -------- task-fs-turns --------\ncli({\n    site: 'trae-solo',\n    name: 'task-fs-turns',\n    access: 'read',\n    description: 'Show the chat-turn timeline for a Trae SOLO task as git tags (before-chat-turn-* / after-chat-turn-*).',\n    domain: 'localhost',\n    browser: false,\n    strategy: Strategy.LOCAL,\n    args: [\n        { name: 'task-id', positional: true, required: true, help: 'Task UUID (folder name under snapshot/)' },\n        { name: 'limit', type: 'int', required: false, default: 50 },\n    ],\n    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) => ({","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/task-fs.js#L87-L123","documentation":"An ArgumentError from the task tag/history command when the positional --task-id argument is missing or whitespace-only after trimming. The task id is required to locate the snapshot repo (snapshotRepoFor), so validation fails before any git access.","triggerScenarios":"Invoking the command without the positional task-id, with an empty string, or in a script where the id variable was empty.","commonSituations":"Forgot to paste the UUID; variable interpolation in a script yielded empty; confusion between positional and named flags (passing --task-id where a bare positional is expected or vice versa).","solutions":["Pass the task UUID positionally, exactly as listed by `opencli trae-solo task-fs-list` (folder name under snapshot/).","Guard scripts: [ -n \"$TID\" ] || exit 1 before calling.","Check the command's arg spec — supply it in the accepted form (positional vs --task-id flag)."],"exampleFix":"// before\nTID=\"\"; opencli trae-solo task-tags \"$TID\"\n// after\nopencli trae-solo task-fs-list   # copy Task Id\nTID=<task-uuid>; [ -n \"$TID\" ] && opencli trae-solo task-tags \"$TID\"","handlingStrategy":"validation","validationCode":"const tid = String(args['task-id'] || '').trim();\nif (!tid) { console.error('usage: task-tags <task-uuid>'); process.exit(2); }\nif (!fs.existsSync(path.join(snapshotRepoFor(tid), '.git'))) throw new Error(`no snapshot repo for ${tid}`);","typeGuard":"function hasTaskId(args) { return typeof args['task-id'] === 'string' && args['task-id'].trim().length > 0; }","tryCatchPattern":"try {\n  await taskTags(args);\n} catch (e) {\n  if (/^task-id required$/.test(e.message)) console.error('Pass the UUID from task-fs-list as a positional argument');\n  throw e;\n}","preventionTips":["Copy task ids from task-fs-list output, never retype","Check empty shell variables in scripts before invoking","Use the positional form expected by the command spec","Pre-check the snapshot repo (.git exists) to give a clearer failure than a bare git error"],"tags":["argument-validation","missing-argument","cli"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}