Files
claude-mem/src/sdk
Umut Polat 9dbf63f5d4 fix: prevent LLM from using <observation> tags in summary responses (#1345)
The SDK agent's conversation history is heavily biased toward
<observation> output. By the time a summarize prompt arrives, the
in-context conditioning can cause the LLM to respond with <observation>
tags instead of the expected <summary> tags. parseSummary() then returns
null and the summary is silently lost.

Two changes:
- Add explicit mode-switch instructions at the top of the summary prompt
  telling the LLM not to use <observation> tags and that only <summary>
  output will be accepted
- Add a warning log in parseSummary() when <observation> tags are found
  in a response that has no <summary> block, making the issue visible
  in logs instead of silently discarding

Fixes #1312

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
2026-03-12 19:57:52 -07:00
..