{"record":{"id":"b905b181b75ae911","repo":"chatboxai/chatbox","slug":"missing-provider-or-configure-a-chatbox-license","errorCode":null,"errorMessage":"Missing --provider (or configure a Chatbox license).","messagePattern":"Missing --provider \\(or configure a Chatbox license\\)\\.","errorType":"validation","errorClass":"ChatboxCliUsageError","httpStatus":null,"severity":"warning","filePath":"src/renderer/packages/chatbox-cli/images.ts","lineNumber":219,"sourceCode":"  if (boundSignature && !boundRequest) {\n    throw new Error(`Stored image execution signature is invalid for tool call ${cacheKey}.`)\n  }\n\n  const settings = settingsStore.getState()\n  let availableModels: Awaited<ReturnType<typeof getAvailableImageModels>> | undefined\n  let provider = approvedRequest?.provider ?? requestedProvider ?? boundRequest?.provider\n  let modelId = approvedRequest?.modelId ?? requestedModelId ?? boundRequest?.modelId\n  if (!provider || !modelId) {\n    availableModels = await getAvailableImageModels(settings)\n    const selected = provider\n      ? availableModels.find((model) => model.provider === provider)\n      : modelId\n        ? availableModels.find((model) => model.modelId === modelId)\n        : availableModels[0]\n    provider ??= selected?.provider\n    modelId ??= selected?.modelId\n  }\n  if (!provider) throw new ChatboxCliUsageError('Missing --provider (or configure a Chatbox license).')\n  if (!modelId) throw new ChatboxCliUsageError('Missing --model.')\n  const signature = JSON.stringify({ prompt, provider, modelId, count, aspectRatio, dalleStyle })\n  if (existing) {\n    if (existing.signature !== signature) {\n      throw new Error(`Tool call ${cacheKey} was reused with different image arguments.`)\n    }\n    return existing.promise\n  }\n\n  if (persistedExecutionValue !== null) {\n    if (persistedExecutionValue.signature !== signature) {\n      throw new Error(`Tool call ${cacheKey} was reused with different image arguments.`)\n    }\n    const persistedRecord = await platform.getImageGenerationStorage().getById(persistedExecutionValue.recordId)\n    if (!persistedRecord) {\n      throw new Error(\n        'The image record linked to this approved tool call no longer exists. Start a new request and ask the user to approve it again.'\n      )","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/chatbox-cli/images.ts#L201-L237","documentation":"ChatboxCliUsageError thrown when, after resolution from approvedRequest.provider, requestedProvider, boundRequest.provider, and the first available model, provider is still falsy. Image generation needs a concrete provider to route the billable call; absent one, the command refuses to proceed.","triggerScenarios":"No --provider flag, no bound/active model selection, no configured Chatbox license that supplies a default, and getAvailableImageModels returned an empty list.","commonSituations":"Fresh install with no provider configured, license not yet activated, all image models excluded in settings, or missing API keys for every image-capable provider.","solutions":["Configure at least one image-capable provider with valid credentials in Chatbox settings.","Activate/configure the Chatbox license so a default model is available.","Pass --provider explicitly (and --model) on the command, e.g. ['image','generate','--prompt',p,'--provider','openai'].","Run 'chatbox image models' to confirm which providers/models are actually available."],"exampleFix":"// before\nawait executeChatboxCliCommand({ argv: ['image','generate','--prompt', p] }, ctx)\n\n// after\nawait executeChatboxCliCommand({ argv: ['image','generate','--prompt', p, '--provider', 'openai', '--model', 'dall-e-3'] }, ctx)","handlingStrategy":"validation","validationCode":"// Resolve a provider/model before dispatching, falling back to the first available.\nconst models = await executeChatboxCliCommand({ argv: ['image','models'] }, ctx)\nif (!models.results?.length) {\n  return { error: 'Configure an image provider or activate a Chatbox license first', kind: 'usage' }\n}\nconst picked = models.results[0]\nawait executeChatboxCliCommand({ argv: ['image','generate','--prompt', p, '--provider', picked.provider, '--model', picked.modelId] }, ctx)","typeGuard":"function hasProviderModel(input: unknown): input is { provider: string; modelId: string } {\n  return (\n    typeof input === 'object' && input !== null &&\n    typeof (input as any).provider === 'string' &&\n    typeof (input as any).modelId === 'string'\n  )\n}","tryCatchPattern":"const res = await executeChatboxCliCommand({ argv }, ctx)\nif (!res.ok && res.kind === 'usage' && res.error.includes('Missing --provider')) {\n  // configure a provider/license or pass --provider explicitly\n}","preventionTips":["Configure at least one image-capable provider with valid credentials.","Activate the Chatbox license for a default model.","Run ['image','models'] to confirm availability before generating."],"tags":["chatbox-cli","usage","image-generation","configuration","license"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}