fix(qqbot): support Windows local media sends - #26098
Open
LeonSGP43 wants to merge 1 commit into
Open
Conversation
1 task
This was referenced May 30, 2026
Closed
This was referenced Jun 6, 2026
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tackling QQBot media delivery. The Windows raw-path part has since landed on main, but QQBot standalone media delivery remains needed.
Problems
- The new live-adapter-only route would not cover documented standalone callers.
hermes sendwraps this shared send engine outside the gateway process (hermes_cli/send_cmd.py:4-20), and cron invokes_send_to_platform()in a fresh event loop (cron/scheduler.py:1902-1904). A process-local adapter singleton cannot be present in those callers. - The Windows bare-path extraction changes are superseded by
51d165a8e: currentgateway/platforms/base.py:3728-3731already handlesC:\\...andC:/..., with regression tests attests/gateway/test_extract_local_files.py:342-361.
Suggested changes
- Re-scope the salvage to a QQBot standalone/direct sender for media, with tests for CLI/cron delivery; retain a live adapter only as an optional fast path.
Automated hermes-sweeper review.
| last_result = result | ||
| return last_result | ||
|
|
||
| # --- QQBot: native media attachment support via running gateway adapter --- |
Contributor
There was a problem hiding this comment.
This branch only works when the caller shares a process with a live QQBot adapter. hermes send and cron invoke the same send engine standalone, so get_active_adapter() will be empty there; please provide a standalone/direct QQBot media sender or an explicit fallback.
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.
What does this PR do?
Fixes the QQBot local-media delivery path for Windows-origin screenshot workflows.
send_messagecan now hand QQBot media files to the live gateway adapter, and the gateway path extraction helpers now normalize Windowsfile://...image URLs plus bare absolute Windows media paths so those files are treated as attachments instead of leaked text.This is adjacent to, but not the same as, the older QQBot live-send PR for
#23825: this change specifically covers media-only sends and Windows local path extraction for#26041.Related Issue
Fixes #26041
Type of Change
Changes Made
send_messagemedia files through the live adapter's native upload methods<img src=...>file://URLs, including Windows drive-letter formsextract_local_files()How to Test
uv run --frozen --extra dev --extra messaging python -m pytest -o addopts='' tests/gateway/test_platform_base.py tests/gateway/test_extract_local_files.py tests/gateway/test_qqbot.py tests/tools/test_send_message_tool.pyuv run --frozen --extra dev ruff check gateway/platforms/base.py gateway/platforms/qqbot/adapter.py gateway/platforms/qqbot/__init__.py tools/send_message_tool.py tests/gateway/test_platform_base.py tests/gateway/test_extract_local_files.py tests/gateway/test_qqbot.py tests/tools/test_send_message_tool.pyMEDIA:C:\Users\...\shot.pngor<img src="file:///C:/Users/.../shot.png" />and confirm the screenshot is uploaded as media instead of left in the text body.Notes
83ecdeb65e1515876a0078ccba415a219b0a41c3is green.