openpencil/apps
Fini c86f9dfdc2 fix(ai): rename element-tools flag to VITE_ENABLE_ELEMENT_TOOLS
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.
2026-04-21 00:35:07 +08:00
..
cli chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
desktop test(electron): unblock desktop/git tests on git 2.36 + stubbed electron 2026-04-20 01:22:28 +08:00
web fix(ai): rename element-tools flag to VITE_ENABLE_ELEMENT_TOOLS 2026-04-21 00:35:07 +08:00