{"record":{"id":"2ac7b1a67cd78afe","repo":"chatboxai/chatbox","slug":"missing-image-generation-record-id","errorCode":null,"errorMessage":"Missing image generation record id.","messagePattern":"Missing image generation record id\\.","errorType":"validation","errorClass":"ChatboxCliUsageError","httpStatus":null,"severity":"warning","filePath":"src/renderer/packages/chatbox-cli/images.ts","lineNumber":358,"sourceCode":"    }\n  })\n}\n\nexport const imageCommands: ChatboxCliCommandDefinition[] = [\n  {\n    path: ['image', 'generate'],\n    description: 'Request approval, then start a callback-driven image background task. Never poll for completion.',\n    usage:\n      'chatbox image generate --prompt <text> [--provider <id>] [--model <id>] [--count 1] [--aspect-ratio <ratio>]',\n    execute: generateImage,\n  },\n  {\n    path: ['image', 'status'],\n    description: 'Read an image generation record.',\n    usage: 'chatbox image status <record-id>',\n    async execute({ parsed }) {\n      const recordId = parsed.positionals[0]\n      if (!recordId) throw new ChatboxCliUsageError('Missing image generation record id.')\n      const record = await platform.getImageGenerationStorage().getById(recordId)\n      if (!record) throw new ChatboxCliUsageError(`Image generation record not found: ${recordId}`)\n      return compactRecord(record)\n    },\n  },\n  {\n    path: ['image', 'history'],\n    description: 'List recent image generation records.',\n    usage: 'chatbox image history [--limit 10] [--cursor 0]',\n    async execute({ parsed }) {\n      const limit = integerFlag(parsed, 'limit', { defaultValue: 10, min: 1, max: 20 })\n      const cursor = integerFlag(parsed, 'cursor', { defaultValue: 0, min: 0, max: 10_000_000 })\n      const page = await platform.getImageGenerationStorage().getPage(cursor, limit)\n      return {\n        scope: 'global',\n        items: page.items.map(compactRecord),\n        nextCursor: page.nextCursor,\n        total: page.total,","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/chatbox-cli/images.ts#L340-L376","documentation":"ChatboxCliUsageError thrown by the 'image status' command when parsed.positionals[0] is falsy. The command requires exactly one record-id positional to look up a stored image-generation record.","triggerScenarios":"Calling 'image status' with no arguments, or with an empty first positional.","commonSituations":"An LLM calling status without the callback-provided id, or a script missing the record id.","solutions":["Pass the record id returned by the generate callback as the first positional.","If the id is unknown, list recent records with ['image','history'] first.","Validate the id is non-empty before dispatching."],"exampleFix":"// before\nawait executeChatboxCliCommand({ argv: ['image','status'] }, ctx)\n\n// after\nif (!recordId) return runImageHistoryFirst()\nawait executeChatboxCliCommand({ argv: ['image','status', recordId] }, ctx)","handlingStrategy":"validation","validationCode":"const recordId = String(rawId ?? '').trim()\nif (!recordId) {\n  return { error: 'A record id is required', kind: 'usage' }\n}\nawait executeChatboxCliCommand({ argv: ['image','status', recordId] }, ctx)","typeGuard":"function isRecordId(input: unknown): input is string {\n  return typeof input === 'string' && input.trim().length > 0\n}","tryCatchPattern":"const res = await executeChatboxCliCommand({ argv: ['image','status', id] }, ctx)\nif (!res.ok && res.kind === 'usage' && res.error.startsWith('Missing image generation record id')) {\n  // obtain the id from the generate callback or image history\n}","preventionTips":["Pass the record id returned by the generate callback as the first positional.","Use ['image','history'] to obtain a valid id when unknown.","Validate the id is non-empty before dispatching."],"tags":["chatbox-cli","usage","image-generation","validation"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}