managarten/services/mana-ai/src
Till JS f7536bc0b9 feat(shared-ai): route compactor to Haiku-tier model by default (M2.5)
compactHistory() now defaults to DEFAULT_COMPACT_MODEL =
'google/gemini-2.5-flash-lite' when the caller doesn't override. Lite
is ~3–5x cheaper than gemini-2.5-flash with near-identical
summarisation quality — summarisation doesn't need the same tier as
reasoning + tool-calling, and the compactor fires exactly when token
spend is highest, so the cheaper route saves exactly where it matters.

CompactHistoryOptions.model is now optional. All three consumers
(mana-ai tick, webapp Companion, webapp Mission runner) drop their
explicit gemini-2.5-flash override and let the default apply.

This is the pragmatic M2.5: no mana-llm changes. The "tier" abstraction
(X-Model-Tier header, env-routed aliases) from the Claude-Code report
makes sense only once multiple utility tasks need cheaper routing —
topic-detection, classification, command-injection checks. Today only
the compactor wants it, and a model constant is the simplest contract
that works.

2 new tests (default applied + override honoured). 79 shared-ai tests
green, all three consumers type-check clean. One pre-existing unrelated
type error in apps/mana/apps/web/src/lib/modules/wardrobe/queries.ts
(not touched by this commit).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 18:26:50 +02:00
..
clients feat(mana-ai): v0.7 — cross-tick Deep Research Max pre-planning 2026-04-22 17:56:06 +02:00
cron feat(shared-ai): route compactor to Haiku-tier model by default (M2.5) 2026-04-23 18:26:50 +02:00
crypto feat(mana-ai): encrypted resolver + tick uses Mission Grant to decrypt scoped inputs 2026-04-15 13:42:31 +02:00
db feat(mana-ai): v0.7 — cross-tick Deep Research Max pre-planning 2026-04-22 17:56:06 +02:00
middleware feat(mana-ai): scaffold server-side Mission Runner (v0.1) 2026-04-14 23:48:30 +02:00
planner feat(agent-loop): expose compactionsDone + compactedReminder producer 2026-04-23 15:36:21 +02:00
config.ts feat(mana-ai): wire context-window compactor into mission runner (M2.3) 2026-04-23 15:28:20 +02:00
index.ts feat(ai): Mission Grant consent UI + Workbench audit tab 2026-04-15 13:53:11 +02:00
metrics.ts feat(mana-ai): wire context-window compactor into mission runner (M2.3) 2026-04-23 15:28:20 +02:00
tracing.ts feat(mana-ai): OpenTelemetry tracing + Grafana Tempo backend 2026-04-16 15:21:23 +02:00