fix: stop storing MCP image/audio base64 in file metadata (#30419)

When an MCP tool returns an image or audio item, the file is uploaded to storage, but the whole MCP item, including its base64 payload, was also passed as upload metadata. That metadata is persisted in the file table's meta column, so every such result was stored twice: once in storage and once as base64 in the database, growing the DB and every file query that loads meta.

The MCP path now passes only chat_id, message_id and session_id, the same metadata the non-MCP tool image path already stores. Nothing reads the removed key.

Fixes #30411
This commit is contained in:
Classic298
2026-09-23 23:54:23 -04:00
committed by GitHub
parent f7ce4024d6
commit b6191a0510
-1
View File
@@ -1195,7 +1195,6 @@ async def process_tool_result(
'chat_id': metadata.get('chat_id', None),
'message_id': metadata.get('message_id', None),
'session_id': metadata.get('session_id', None),
'result': item,
},
user,
)