From 7dc5af2e884bd600024f5304f37b10f4543d1c8b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 5 Apr 2026 19:33:54 -0400 Subject: [PATCH] feat(chat): add tool_calls param to add_message for synthetic messages Needed by the Discuss endpoint to persist synthetic read_article tool exchanges before triggering generation. Co-Authored-By: Claude Sonnet 4.6 --- src/fabledassistant/services/chat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fabledassistant/services/chat.py b/src/fabledassistant/services/chat.py index f229f83..fbc8fae 100644 --- a/src/fabledassistant/services/chat.py +++ b/src/fabledassistant/services/chat.py @@ -186,6 +186,7 @@ async def add_message( content: str, context_note_id: int | None = None, status: str | None = None, + tool_calls: list | None = None, ) -> Message: async with async_session() as session: kwargs: dict = dict( @@ -196,6 +197,8 @@ async def add_message( ) if status is not None: kwargs["status"] = status + if tool_calls is not None: + kwargs["tool_calls"] = tool_calls msg = Message(**kwargs) session.add(msg) # Touch conversation updated_at