fix(message): apply media path filtering and drop attachment count from return value
Conflict resolution correction: HEAD's message.py retained raw media list and attachment count in return string, but tests from 3de30bb require stripped/filtered media_paths and a plain return message. Aligns HEAD behavior with cherry-picked tests.
This commit is contained in:
@@ -89,11 +89,10 @@ class MessageTool(Tool):
|
||||
if candidate:
|
||||
media_paths.append(candidate)
|
||||
|
||||
msg = OutboundMessage(channel=channel, chat_id=chat_id, content=content, media=media or [])
|
||||
msg = OutboundMessage(channel=channel, chat_id=chat_id, content=content, media=media_paths)
|
||||
|
||||
try:
|
||||
await self._send_callback(msg)
|
||||
media_info = f" with {len(media)} attachments" if media else ""
|
||||
return f"Message sent to {channel}:{chat_id}{media_info}"
|
||||
return f"Message sent to {channel}:{chat_id}"
|
||||
except Exception as e:
|
||||
return f"Error sending message: {str(e)}"
|
||||
|
||||
Reference in New Issue
Block a user