Bug Fixes
A 300-photo contents upload was burning 9,406 Haiku dedup calls ($21.59) and freezing the UI. Root causes: project-inventory dispatched 30+ times per session with stacked multipliers, each dispatch re-ran the per-cluster dedup, and failed retries amplified everything.
Fixed by:
- State-gated dispatch: Inventory projection now uses a lock to coalesce concurrent dispatches into one, preventing the fan-out.
- Workload-scaled AI budget: Each run gets a per-cluster cap on model calls; exhaustion falls back to deterministic dedup instead of failing.
- Single-attempt tasks: Disabled Trigger.dev retries on photo and inventory tasks so in-process budgets don't reset across attempts.
- Real-time token refresh: Realtime connections stay live for sessions open >1 hour (was expiring silently mid-analysis).
What's New
- Projection status banner: DEGRADED (AI budget hit fallback) and FAILED (pipeline crash) states now show an actionable banner instead of a frozen progress bar.
Impact: 127-photo test went from 34 Haiku dedup calls ($0.074) in one run — a 124× per-photo cost reduction.