{"record":{"id":"0d0bacff9e0b4fa0","repo":"chatboxai/chatbox","slug":"image-generation-record-not-found-recordid","errorCode":null,"errorMessage":"Image generation record not found: ${recordId}","messagePattern":"Image generation record not found: (.+?)","errorType":"validation","errorClass":"ChatboxCliUsageError","httpStatus":null,"severity":"warning","filePath":"src/renderer/packages/chatbox-cli/images.ts","lineNumber":360,"sourceCode":"}\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,\n      }\n    },","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/chatbox-cli/images.ts#L342-L378","documentation":"ChatboxCliUsageError thrown by 'image status' after platform.getImageGenerationStorage().getById(recordId) returns null. Classified as usage (kind:'usage'), it indicates the supplied record id does not match any stored image-generation record.","triggerScenarios":"A record id that was deleted, never existed, belongs to another device/account, or is mistyped. Also possible after history eviction or a storage reset.","commonSituations":"Stale ids from a cleared history, cross-device lookup where the record is absent locally, post-migration id changes, or copy/paste typos.","solutions":["List recent records via ['image','history'] and use a current id.","Confirm the id belongs to the active account/device before reading.","Handle the { ok:false, kind:'usage' } result by prompting the user to pick a valid record."],"exampleFix":"// before\nawait executeChatboxCliCommand({ argv: ['image','status', staleId] }, ctx)\n\n// after\nconst res = await executeChatboxCliCommand({ argv: ['image','status', id] }, ctx)\nif (!res.ok && res.kind === 'usage') {\n  const hist = await executeChatboxCliCommand({ argv: ['image','history'] }, ctx)\n  // surface history to the user and retry with a chosen record id\n}","handlingStrategy":"validation","validationCode":"// Confirm the record exists by listing history before reading a single record.\nconst hist = await executeChatboxCliCommand({ argv: ['image','history'] }, ctx)\nconst known = new Set(hist.items.map((r) => r.id))\nif (!known.has(recordId)) {\n  return { error: 'Record not found locally', kind: 'usage' }\n}\nawait executeChatboxCliCommand({ argv: ['image','status', recordId] }, ctx)","typeGuard":null,"tryCatchPattern":"const res = await executeChatboxCliCommand({ argv: ['image','status', id] }, ctx)\nif (!res.ok && res.kind === 'usage' && res.error.startsWith('Image generation record not found')) {\n  // re-list history and prompt the user to pick a current record\n}","preventionTips":["Do not cache record ids long-term; re-list history when a lookup misses.","Confirm the id belongs to the active account/device before reading.","Handle the usage result by prompting for a fresh selection."],"tags":["chatbox-cli","usage","image-generation","data-not-found"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}