Bugfix: Chrome extension panel fails in production — only works with...
Documentation for Sessions
🐛 Bugfix: Chrome extension panel fails in production — only works with...
Date: 2026-03-01
Time: 01:30:20 UTC
Session: gspace1-158.2
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Chrome extension panel fails in production — only works with localhost servers running
Task: Fix chrome extension production mode
🎯 Decision Made
Chosen:
Added production fallback at 3 layers: (1) sidepanel.js resolveAiAppUrl now tries https://ai.gograb.space after all localhost probes fail, (2) service-worker.js checkLocalAndFallback now covers sideloaded extensions via ExtensionEnv._prodFallbackActive flag, (3) env-config.js isLocalMode respects _prodFallbackActive to switch all URLs to production
Options Considered:
- Add production fallback to resolveAiAppUrl only (sidepanel-only fix)
- Change isDev detection to not always return true for sideloaded (would break dev workflow)
- Add _prodFallbackActive flag at env-config level + sidepanel fallback + service worker fallback (chosen)
- Ship to Chrome Web Store where isDev would correctly be false (doesn't help sideloaded dev use case)
💭 Reasoning
Root cause: sideloaded extensions always have isDev=true (no update_url in manifest), making isLocalMode always true, forcing ALL URLs to localhost. resolveAiAppUrl only probed localhost ports with zero production fallback. Session 154 auto-fallback was guarded by _devModeOverride which is false for sideloaded extensions. Fix adds production fallback at the sidepanel level (immediate UX fix) and service worker level (background MCP connection fix), with a new _prodFallbackActive flag in env-config that reverses isLocalMode when localhost is unreachable.
📁 Files Involved
apps/vitto-chrome-extension/sidepanel/sidepanel.jsapps/vitto-chrome-extension/shared/env-config.jsapps/vitto-chrome-extension/background/service-worker.js
🔗 Related
- Decision ID:
dev_1772328616827_2hiayyu - Session: 158
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation