chatboxai/chatbox · warning · Error

No task ID found for this record

Error message

No task ID found for this record

What it means

resumeGeneration requires record.taskId to re-poll the remote task. If the record exists but never received a taskId, resume cannot query the backend — there is no task to poll. The check at line 452 guards pollImageTask(record.taskId, ...) against an undefined id.

Solutions

  1. Offer retry (not resume) in the UI when record.taskId is missing; resume only when taskId is present.
  2. Ensure submitImageGeneration writes taskId to the record in the same transaction as creation.
  3. Return a typed error so the UI can redirect the user to retry.
  4. Filter the resume action by record.taskId truthiness in the record card component.

Example fix

// before
if (!record.taskId) {
  throw new Error('No task ID found for this record')
}
// after
if (!record.taskId) {
  throw new RetryableGenerationError('No task ID found for this record')
}
Defensive patterns

Strategy: type-guard

Validate before calling

const record = await platform.getImageGenerationStorage().getById(recordId)
if (record && !record.taskId) {
  // offer retry, not resume
  promptRetry()
  return null
}

Type guard

function hasTaskId(r: { taskId?: string | null } | null | undefined): r is { taskId: string } {
  return !!r && typeof r.taskId === 'string' && r.taskId.length > 0
}

Prevention

When it happens

Trigger: The record was created (createRecord) but submitImageGeneration either failed or did not persist the returned taskId before the session ended. Also fires after retryGeneration, which intentionally clears taskId (line ~532) — calling resume on a record mid-retry hits this.

Common situations: A previous generation crashed between record creation and taskId persistence (network drop during submit), or the UI offered a resume action on a record that retryGeneration already reset.

Related errors


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

Appendix: source

Thrown at src/renderer/stores/imageGenerationActions.ts:453

export function clearCurrentRecord(): void {
  imageGenerationStore.getState().setCurrentRecordId(null)
}

export async function resumeGeneration(recordId: string): Promise<ImageGeneration | null> {
  const store = imageGenerationStore.getState()

  if (store.currentGeneratingId !== null) {
    throw new Error('Another image is being generated. Please wait.')
  }

  const record = await platform.getImageGenerationStorage().getById(recordId)
  if (!record) {
    throw new Error('Record not found')
  }

  if (!record.taskId) {
    throw new Error('No task ID found for this record')
  }

  const licenseKey = getLicenseKey()
  store.setCurrentGeneratingId(recordId)

  // Create AbortController for resume operation
  currentAbortController = new AbortController()
  const signal = currentAbortController.signal

  try {
    // Check current status, then poll if not finished
    const currentStatus = await pollImageTask(record.taskId, licenseKey, signal)

    let finalResult = currentStatus
    if (!currentStatus.is_finished) {
      finalResult = await pollTaskUntilComplete(record.taskId, licenseKey, { signal })
    }

View on GitHub (pinned to 81571269ad)