managarten/services/mana-ai/src/planner
Till JS 72f7978ed4 feat(agent-loop): expose compactionsDone + compactedReminder producer
Closes the loop on M2: when the compactor fires, the LLM needs to know
it's now seeing a <compact-summary> instead of raw turns so it
doesn't waste a turn asking about lost details or re-executing tools
whose responses are gone.

shared-ai:
  - LoopState grows `compactionsDone: number` (cap-1 by current loop
    policy, but shape kept as count for future multi-compact cycles).
  - runPlannerLoop populates it on each reminder-channel call. New
    loop test asserts [0, 1] sequence: round 1 before compaction,
    round 2 after.

mana-ai:
  - New producer `compactedReminder` — fires severity=info when
    compactionsDone >= 1, wrapped in a German one-liner ("frag nicht
    nach verlorenen Details").
  - Injected FIRST in buildReminderChannel so the LLM frames the rest
    of the round with "I'm looking at a summary" context. Metric
    surface stays `{producer='compacted', severity='info'}`.

4 new reminder tests (3 pure producer + 1 composition-ordering) +
1 loop-wiring test. 77 shared-ai, 20 reminders.test.ts — green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 15:36:21 +02:00
..
llm-client.ts feat(mana-ai): Prometheus metrics for tool-calls, loop rounds, provider errors 2026-04-20 20:48:29 +02:00
news-research-client.ts feat(ai-tools): server-side web-research + contacts for agents 2026-04-16 12:25:45 +02:00
reminders.test.ts feat(agent-loop): expose compactionsDone + compactedReminder producer 2026-04-23 15:36:21 +02:00
reminders.ts feat(agent-loop): expose compactionsDone + compactedReminder producer 2026-04-23 15:36:21 +02:00
tools.test.ts feat(mana-ai): server runner on runPlannerLoop, drops text-JSON parser 2026-04-20 16:39:20 +02:00
tools.ts feat(mana-ai): server runner on runPlannerLoop, drops text-JSON parser 2026-04-20 16:39:20 +02:00