chatboxai/chatbox · warning · ChatboxCliUsageError

Missing --provider (or configure a Chatbox license).

Error message

Missing --provider (or configure a Chatbox license).

What it means

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.

Source

Thrown at src/renderer/packages/chatbox-cli/images.ts:219

  if (boundSignature && !boundRequest) {
    throw new Error(`Stored image execution signature is invalid for tool call ${cacheKey}.`)
  }

  const settings = settingsStore.getState()
  let availableModels: Awaited<ReturnType<typeof getAvailableImageModels>> | undefined
  let provider = approvedRequest?.provider ?? requestedProvider ?? boundRequest?.provider
  let modelId = approvedRequest?.modelId ?? requestedModelId ?? boundRequest?.modelId
  if (!provider || !modelId) {
    availableModels = await getAvailableImageModels(settings)
    const selected = provider
      ? availableModels.find((model) => model.provider === provider)
      : modelId
        ? availableModels.find((model) => model.modelId === modelId)
        : availableModels[0]
    provider ??= selected?.provider
    modelId ??= selected?.modelId
  }
  if (!provider) throw new ChatboxCliUsageError('Missing --provider (or configure a Chatbox license).')
  if (!modelId) throw new ChatboxCliUsageError('Missing --model.')
  const signature = JSON.stringify({ prompt, provider, modelId, count, aspectRatio, dalleStyle })
  if (existing) {
    if (existing.signature !== signature) {
      throw new Error(`Tool call ${cacheKey} was reused with different image arguments.`)
    }
    return existing.promise
  }

  if (persistedExecutionValue !== null) {
    if (persistedExecutionValue.signature !== signature) {
      throw new Error(`Tool call ${cacheKey} was reused with different image arguments.`)
    }
    const persistedRecord = await platform.getImageGenerationStorage().getById(persistedExecutionValue.recordId)
    if (!persistedRecord) {
      throw new Error(
        'The image record linked to this approved tool call no longer exists. Start a new request and ask the user to approve it again.'
      )

View on GitHub (pinned to 81571269ad)

Solutions

  1. Configure at least one image-capable provider with valid credentials in Chatbox settings.
  2. Activate/configure the Chatbox license so a default model is available.
  3. Pass --provider explicitly (and --model) on the command, e.g. ['image','generate','--prompt',p,'--provider','openai'].
  4. Run 'chatbox image models' to confirm which providers/models are actually available.

Example fix

// before
await executeChatboxCliCommand({ argv: ['image','generate','--prompt', p] }, ctx)

// after
await executeChatboxCliCommand({ argv: ['image','generate','--prompt', p, '--provider', 'openai', '--model', 'dall-e-3'] }, ctx)
Defensive patterns

Strategy: validation

Validate before calling

// Resolve a provider/model before dispatching, falling back to the first available.
const models = await executeChatboxCliCommand({ argv: ['image','models'] }, ctx)
if (!models.results?.length) {
  return { error: 'Configure an image provider or activate a Chatbox license first', kind: 'usage' }
}
const picked = models.results[0]
await executeChatboxCliCommand({ argv: ['image','generate','--prompt', p, '--provider', picked.provider, '--model', picked.modelId] }, ctx)

Type guard

function hasProviderModel(input: unknown): input is { provider: string; modelId: string } {
  return (
    typeof input === 'object' && input !== null &&
    typeof (input as any).provider === 'string' &&
    typeof (input as any).modelId === 'string'
  )
}

Try / catch

const res = await executeChatboxCliCommand({ argv }, ctx)
if (!res.ok && res.kind === 'usage' && res.error.includes('Missing --provider')) {
  // configure a provider/license or pass --provider explicitly
}

Prevention

When it happens

Trigger: No --provider flag, no bound/active model selection, no configured Chatbox license that supplies a default, and getAvailableImageModels returned an empty list.

Common situations: 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.

Related errors


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/b905b181b75ae911. Report an issue: GitHub.