Structured digest of an ended learning session — written to
learning_sessions.summary jsonb. Mirrors the JSON shape produced by
the server's SESSION_DIGEST_PROMPT.
Generates a session digest by calling the proxy with isSessionDigest: true, then persists the JSON to learning_sessions.summary. The
digest is later read by the proxy's prior-session fetch when the
learner returns to the same topic, so older sessions surface as
compressed context rather than raw merged transcript.
Generates a session digest by calling the proxy with isSessionDigest: true, then persists the JSON to learning_sessions.summary. The
digest is later read by the proxy's prior-session fetch when the
learner returns to the same topic, so older sessions surface as
compressed context rather than raw merged transcript.
Strip markdown fences (defensive — the SESSION_DIGEST_PROMPT instructs
no fences, but small models occasionally add them) and decode the
JSON object. Throws FormatException on malformed input.