feat(channels): upload file attachments via IM channels (Slack, Telegram, Feishu) (#1040)

This commit is contained in:
DanielWalnut
2026-03-10 09:11:57 +08:00
committed by GitHub
parent 0409f8cefd
commit 33f086b612
9 changed files with 720 additions and 15 deletions

View File

@@ -350,6 +350,26 @@ class TestExtractResponseText:
}
assert _extract_response_text(result) == "Could you clarify?"
def test_does_not_leak_previous_turn_text(self):
"""When current turn AI has no text (only tool calls), do not return previous turn's text."""
from src.channels.manager import _extract_response_text
result = {
"messages": [
{"type": "human", "content": "hello"},
{"type": "ai", "content": "Hi there!"},
{"type": "human", "content": "export data"},
{
"type": "ai",
"content": "",
"tool_calls": [{"name": "present_files", "args": {"filepaths": ["/mnt/user-data/outputs/data.csv"]}}],
},
{"type": "tool", "name": "present_files", "content": "ok"},
]
}
# Should return "" (no text in current turn), NOT "Hi there!" from previous turn
assert _extract_response_text(result) == ""
# ---------------------------------------------------------------------------
# ChannelManager tests