Browser-side helper (`isElementToolsFlagEnabled` in model-profiles.ts) reads via `import.meta.env` as the client fallback, but Vite's default `envPrefix` only exposes `VITE_`-prefixed variables to the browser bundle. The previous name `ENABLE_ELEMENT_TOOLS_IN_ORCHESTRATOR` would be inlined as `undefined` at build time for client code — meaning flipping the flag in `.env.local` could NEVER actually enable the feature from the embedded orchestrator, defeating the Phase 2 rollout plan. Rename to `VITE_ENABLE_ELEMENT_TOOLS` so client code can actually see the toggle. Server-side `process.env` reads work with any name, so one variable name now covers both sides of the SSR boundary. Docstring in model-profiles.ts now explicitly calls out the VITE_ prefix requirement so future edits don't regress — the "bare name would be inlined as undefined" point is worth preserving in-file. Also updated the orchestrator-sub-agent.ts error message that points users at the flag so its instructions match the real var name. Tests: 23 → 23 (renamed FLAG constant, all cases still pass). Full suite 1866/1866 green. |
||
|---|---|---|
| .. | ||
| public | ||
| server | ||
| src | ||
| CLAUDE.md | ||
| components.json | ||
| dev.ts | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.ts | ||