openpencil/apps/web
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
..
public V0.5.0 (#67) 2026-03-22 09:44:04 +08:00
server V0.7.3 (#111) 2026-04-15 22:19:12 +08:00
src fix(ai): rename element-tools flag to VITE_ENABLE_ELEMENT_TOOLS 2026-04-21 00:35:07 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
components.json V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
dev.ts V0.7.2-bugfix (#109) 2026-04-14 21:42:56 +08:00
package.json chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
tsconfig.json V0.7.2-bugfix (#109) 2026-04-14 21:42:56 +08:00
vite.config.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00