fix(wecombot): deliver sandbox outbox media through full pipeline chain#2328
Open
MIKAZE3 wants to merge 6 commits into
Open
fix(wecombot): deliver sandbox outbox media through full pipeline chain#2328MIKAZE3 wants to merge 6 commits into
MIKAZE3 wants to merge 6 commits into
Conversation
dadachann
requested changes
Jul 16, 2026
dadachann
left a comment
Contributor
There was a problem hiding this comment.
这里仍混入了 monitoring.py,与 WeCom 媒体投递无关,请移出。分支也已经和 master 冲突,请 rebase 后保留当前 HITL / synthetic-event 逻辑,并清掉临时 debug 日志。
MIKAZE3
force-pushed
the
fix/wecombot-image-delivery
branch
from
July 16, 2026 10:00
c7cece1 to
4497d95
Compare
Contributor
Author
|
两个测试失败的原因和修复:
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- Integrate _send_media into reply_message and reply_message_chunk so sandbox outbox images/voices/files are uploaded and sent instead of being silently dropped. - Add missing import base64 that caused _send_media to fail with a NameError swallowed by its except clause. - Change yiri2target to return component dicts (text/image/voice/file) so callers can distinguish text from media. - Fix _get_message_for_tool_context using result.first()/row[0] which returned a raw string instead of the ORM object, causing "'str' object has no attribute 'pipeline_id'" in tool call recording. Use result.scalars().first() per SQLAlchemy 2.0 convention.
All failure paths in _send_media silently returned False without any log output, making it impossible to diagnose why images were not delivered. Convert from @staticmethod to instance method and add warning/info logging at every exit point.
…ontent When the last streaming chunk has is_final=True but empty content (e.g. the LLM sends all text in earlier chunks), the 'if result.content' branch is skipped entirely, so _append_outbound_attachments never runs and sandbox outbox images are silently dropped. Add an elif branch for _is_final_assistant_message that creates an empty MessageChain and still collects outbox attachments, so images are delivered even when the final chunk carries no text.
_read_outbox_via_exec used execute_tool which returns _serialize_result where stdout is truncated to output_limit_chars (4000). A 7KB JPEG encodes to ~9400 base64 chars, so the JSON payload was truncated and json.loads failed silently, returning an empty list. Call client.execute directly to get the raw BoxExecutionResult with untruncated stdout, so base64 file data is preserved.
… is_final check - wrapper.py: restrict outbox collection on empty-content chunks to actual MessageChunk instances with is_final=True, not generic Mock objects that happen to have role='assistant' - test_box_service.py: update _read_outbox_via_exec tests to mock client.execute (returning BoxExecutionResult) instead of execute_tool, matching the implementation change
MIKAZE3
force-pushed
the
fix/wecombot-image-delivery
branch
from
July 17, 2026 04:53
d5ab339 to
103b8fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述 / Overview
更改前后对比截图 / Screenshots
检查清单 / Checklist
PR 作者完成 / For PR author
请在方括号间写
x以打勾 / Please tick the box withx项目维护者完成 / For project maintainer