Architecture: How to eliminate hardcoded workspace references and enable d...
Documentation for Sessions
🏗️ Architecture: How to eliminate hardcoded workspace references and enable d...
Date: 2026-02-10
Time: 23:03:18 UTC
Session: gspace1-104.3
Agent: backend
Confidence: 92%
Status: ✅ Documented
📋 Decision Context
Question:
How to eliminate hardcoded workspace references and enable dynamic workspace groups?
Task: Session 104: Smart Workspace Detection and Dynamic Groups
🎯 Decision Made
Chosen:
WorkspaceGroupService reads WORKSPACE_GROUPS env var (format: 'gograb-dev:gspace1,editor2|staging:staging1,staging2'), provides getSiblings() and getGroupMembers(). Chrome extension auto-detects workspace from GET /infrastructure/workspace-config endpoint. All 9 hardcoded workspace references replaced.
Options Considered:
- Environment-driven workspace groups with backend config endpoint
- Hardcode workspace groups in shared library
- Database-driven workspace configuration
- Runtime service discovery
💭 Reasoning
Chrome extensions can't read .env.local (browser context, not filesystem). The MCP server already had workspace-config.ts pattern. Backend endpoint returns workspace config, extension caches in chrome.storage. WorkspaceGroupService replaces 3 hardcoded sibling maps in backend services. Pipe-separated group format allows multiple workspace groups as the platform scales beyond 2 dev workspaces.
📁 Files Involved
apis/backend-ai-api/src/app/infrastructure/services/workspace-group.service.tsapis/backend-ai-api/src/app/infrastructure/infrastructure.controller.tsapis/backend-ai-api/src/app/infrastructure/services/handoff.service.tsapis/backend-ai-api/src/app/infrastructure/controllers/orchestration-relay.controller.tsapps/gograb-ai-extension/background/mcp-connector.js
🔗 Related
- Decision ID:
dev_1770764598429_o626wyj - Session: 104
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation