linshenkx/prompt-optimizer · warning · Error

Remote asset cleanup is not supported by this provider

Error message

Remote asset cleanup is not supported by this provider

What it means

cleanupRemoteSnapshotAssets requires the ability to delete objects, so it first checks that the injected objectStore adapter implements a delete method. Providers without deletion support (read-only or limited adapters) fail fast instead of silently leaving garbage.

Source

Thrown at packages/ui/src/utils/remote-snapshot-backup.ts:713

    }))

  return {
    candidates,
    referencedAssetCount: referenced.size,
    totalCandidateBytes: candidates.reduce((sum, candidate) => sum + (candidate.sizeBytes ?? 0), 0),
  }
}

export const cleanupRemoteSnapshotAssets = async (
  objectStore: RemoteObjectStore,
  onProgress?: RemoteSnapshotProgressReporter,
  options?: {
    minimumAgeMs?: number
    now?: Date
  },
): Promise<RemoteSnapshotCleanupResult> => {
  if (!objectStore.delete) {
    throw new Error('Remote asset cleanup is not supported by this provider')
  }
  const analysis = await analyzeRemoteSnapshotAssetCleanup(objectStore, onProgress, options)
  const failed: Array<{ path: string; message: string }> = []
  let deleted = 0

  for (const [index, candidate] of analysis.candidates.entries()) {
    try {
      onProgress?.({
        phase: 'cleanup-delete',
        current: index + 1,
        total: analysis.candidates.length,
        item: candidate.path,
        deleted,
      })
      await objectStore.delete(candidate.path)
      deleted += 1
    } catch (error) {
      failed.push({ path: candidate.path, message: (error as Error).message })

View on GitHub (pinned to 3e677b1d9f)

Solutions

  1. Use a provider/adapter that implements delete(object deletion)
  2. Implement the delete method on the custom objectStore adapter
  3. Skip cleanup for read-only providers by checking support before calling
Defensive patterns

Strategy: type-guard

Validate before calling

if (!objectStore.delete) { /* skip cleanup, show info message */ }

Type guard

const supportsCleanup = (store: RemoteObjectStore): store is RemoteObjectStore & { delete: NonNullable<RemoteObjectStore['delete']> } => typeof store.delete === 'function'

Prevention

When it happens

Trigger: Calling cleanupRemoteSnapshotAssets with an objectStore adapter whose delete property is undefined — e.g. a read-only/inspection provider or a custom adapter that only implements put/get/list.

Common situations: Custom object store implementation missing the delete method; provider version that hasn't implemented deletion yet; intentionally read-only remote configured for restore-only workflows.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27). Data as JSON: /api/errors/7066ac51e32774cb. Report an issue: GitHub.