{"record":{"id":"76dac311a7a8f722","repo":"jackwener/OpenCLI","slug":"fetch-error-76dac3","errorCode":"FETCH_ERROR","errorMessage":"ONES task info: ${hint}","messagePattern":"ONES task info: (.+?)","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/ones/task.js","lineNumber":52,"sourceCode":"    columns: ['uuid', 'summary', 'number', 'status_uuid', 'assign', 'owner', 'project_uuid', 'updated'],\n    func: async (page, kwargs) => {\n        const id = String(kwargs.id ?? '').trim();\n        if (!id) {\n            throw new CliError('CONFIG', 'task id required', 'Pass the work item uuid from the URL path …/task/<id>');\n        }\n        const team = kwargs.team?.trim() ||\n            process.env.ONES_TEAM_UUID?.trim() ||\n            process.env.ONES_TEAM_ID?.trim();\n        if (!team) {\n            throw new CliError('CONFIG', 'team UUID required', 'Use --team <teamUUID> or set ONES_TEAM_UUID (from …/team/<team>/…).');\n        }\n        const path = `team/${team}/task/${encodeURIComponent(id)}/info`;\n        const data = (await onesFetchInPage(page, path, { method: 'GET' }));\n        if (typeof data.uuid !== 'string') {\n            const hint = typeof data.reason === 'string'\n                ? data.reason\n                : 'Use -f json to inspect response; check id length (often 16) and team.';\n            throw new CliError('FETCH_ERROR', `ONES task info: ${hint}`, 'Confirm task uuid and team match the browser URL.');\n        }\n        return [\n            {\n                uuid: String(data.uuid),\n                summary: String(data.summary ?? ''),\n                number: data.number != null ? String(data.number) : '',\n                status_uuid: String(data.status_uuid ?? ''),\n                assign: String(data.assign ?? ''),\n                owner: String(data.owner ?? ''),\n                project_uuid: String(data.project_uuid ?? ''),\n                updated: formatStamp(data.server_update_stamp),\n            },\n        ];\n    },\n});\n","sourceCodeStart":34,"sourceCodeEnd":68,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/ones/task.js#L34-L68","documentation":"This FETCH_ERROR is thrown when the ONES `team/<team>/task/<id>/info` endpoint returns a payload without a string `uuid` field, meaning the task could not be fetched/verified. The library embeds the API's `reason` (if present) or a generic hint into the message. It guards against silently returning a malformed task object.","triggerScenarios":"The task id is wrong or truncated (ONES task uuids are often 16 chars), the id doesn't belong to the given team, the API returns an error/empty object, or auth is stale so the endpoint returns an error body.","commonSituations":"Copy-pasting a task id from a URL but missing characters; using a task id from team A with --team of team B; expired token returning an unexpected payload; API shape changes.","solutions":["Re-check the task uuid and team UUID against the browser URL …/team/<team>/task/<id>.","Re-run with -f json to see the raw response and the reason field.","Verify the id length (often 16 characters) — re-copy it fully.","Refresh auth (re-login / regenerate token) if the response suggests an auth problem."],"exampleFix":"// before\nopencli ones task 3fa2 --team T1        // truncated id\n// after\nopencli ones task 3fa2b1c9d8e7f601 --team T1","handlingStrategy":"type-guard","validationCode":"if (typeof taskId !== 'string' || taskId.trim().length !== 16) throw new Error('Task uuid must be the full 16-char id from the task URL');","typeGuard":"function isTaskInfo(d) { return d != null && typeof d.uuid === 'string' && d.uuid.length > 0; }","tryCatchPattern":"try {\n  const task = await opencli.ones.task(id, { team });\n} catch (e) {\n  if (e.code === 'FETCH_ERROR' && e.message.startsWith('ONES task info:')) {\n    console.error('Task fetch failed; verify uuid+team match the browser URL.', e.message);\n  } else throw e;\n}","preventionTips":["Copy task ids in full — ONES uuids are often exactly 16 chars.","Ensure the team UUID is the one the task belongs to.","Run with -f json first when debugging to see the raw response reason.","Re-authenticate if responses start returning error bodies."],"tags":["api","network","ones","response-parsing"],"backgroundTag":"unexpected-api-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}