openpencil/apps
Fini 0eb5ca1ada fix(ai): allow elements skill through basic-tier compact filter
Live smoke test with VITE_ENABLE_ELEMENT_TOOLS=1 showed `elements`
missing from the sub-agent prompt — the skill was correctly included
by resolveSkills (hasMcpTools flag fired) but then stripped by
compactSubAgentSkills's basic-tier allow-list. Result: the feature
flag was effectively a no-op on basic-tier models, which is exactly
the tier the A/B v1 data says benefits most (MiniMax/GLM +8-21pp ΔM1).

- Add 'elements' to the basic-tier allowed set in
  compactSubAgentSkills. The `hasMcpTools` gate at resolveSkills is
  still the primary ON/OFF — this just stops the compact step from
  silently dropping the skill downstream.
- Deliberately OMIT 'elements' from the reducedComplexity retry-
  allowed set. Retries are the last-ditch fallback after a full-
  skill attempt already failed; elements.md is ~17k chars and adds
  to the prompt budget we're trying to shrink.

Test fix: model-profiles-element-tools.test.ts was passing in
isolation but failing under the full suite. Root cause: vitest's Node
runner `vi.stubEnv` doesn't reach `import.meta.env` across modules
(per-module import.meta instance) and dev's `.env.local` sets
VITE_ENABLE_ELEMENT_TOOLS=1 at Vite transform time. Changes:
- setFlag() now writes to both process.env AND the test file's own
  import.meta.env object (belt and braces; doesn't cross modules
  but removes the test file's own leakage path).
- Browser-safe (`process` broken) tests changed from
  `toBe(false)` to `not.toThrow()`. The actual regression guarded by
  these tests is the no-throw contract; cross-module env stubbing is
  intractable in the current setup and the boolean path is already
  covered by the "flag OFF" suite through process.env stubs.

Full suite: 200/200 files, 1866/1866 tests, format/tsc clean.
2026-04-21 01:17:46 +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): allow elements skill through basic-tier compact filter 2026-04-21 01:17:46 +08:00