feat(AIChat): support image input and visual follow-up in OneBot - #67
Merged
Merged
Conversation
Yuna-Celisse
marked this pull request as ready for review
October 2, 2026 14:11
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.
AIChat previously sent only text even when the configured model could understand images. OneBot/QQ now exposes image attachments separately from typed URLs, and AIChat sends validated image bytes as image content. Image-only mentions receive a default description prompt; reply-based follow-ups reconstruct images from history.
Vision requires explicit SupportsVision configuration. Downloads have count, size and timeout limits, reject private network destinations and redirects, and validate image formats. Request logs omit image bytes and SDK content logging is disabled for vision. Visual sessions are short-lived to avoid accumulating image data.
Validation: 19 new unit tests pass; the complete automatic suite passes (178 passed, 1 platform skip; external integration tests explicit). All CI checks pass at 0d15e6f. A real-provider integration test using explicitly constructed OneBot events passed image-only recognition, visual reply follow-up, text-only chat and vision-disabled handling against agnes-3.0-flash.
Deployed independently of merging this PR as huajibot-local:vision-0d15e6f. Backed up configuration and plugin data, retained the previous image for rollback, and restarted only the bot. OneBot login, plugin loading and existing panel access checks passed. Other configuration and plugin binaries were preserved. Actual non-bot QQ group-message acceptance passed on 2026-10-02 (Asia/Shanghai): two image mentions and two reply follow-ups were received, each model request included one image, and all four answers were confirmed in OneBot group history. The bot described a logo and a yellow 3D character, and follow-ups retained the corresponding image context. This validates message delivery and multimodal context; it does not guarantee the model correctly identifies every object or character.
Closes #66. This is independent of PR #65; no changes or comments were made to that PR. This first adapter implementation covers OneBot/QQ. Reply history can retain images previously processed by AIChat; it does not fetch arbitrary earlier group images. Expired image source URLs require resending.