feat(events): summary content uses OpenAI system message format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rayhpeng 2026-04-04 09:21:51 +08:00
parent 704f6a9209
commit 362226be6e
2 changed files with 2 additions and 1 deletions

View File

@ -263,7 +263,7 @@ class RunJournal(BaseCallbackHandler):
self._put(
event_type="summary",
category="message",
content=data_dict.get("summary", ""),
content={"role": "system", "content": data_dict.get("summary", "")},
metadata={"replaced_count": data_dict.get("replaced_count", 0)},
)
else:

View File

@ -214,6 +214,7 @@ class TestCustomEvents:
messages = await store.list_messages("t1")
assert len(messages) == 1
assert messages[0]["event_type"] == "summary"
assert messages[0]["content"] == {"role": "system", "content": "Context was summarized."}
@pytest.mark.anyio
async def test_non_summarization_custom_event(self, journal_setup):