C₂₂H₂₅NO₆ 4b097011cf fix(core): Fix image delivery to the model by treating empty modalities as unconfigured (#8451)
* fix(core): 将空 list modalities 视为未配置,修复图片无法传递到模型的问题

migra_helper 将未配置的 modalities 迁移为空 list [],而新增的
_provider_supports_modality()、_assemble_request_context_for_provider()、
_should_fix_modalities_for_provider()、_func_tool_for_provider() 四个函数
对 [] 和 None 的处理不一致,导致所有未在 WebUI 手动配置 modalities 的
provider 无法传递图片、引用图片被跳过、工具被错误清除。

修改策略:将 [] 与 None 统一视为未配置状态,保持向后兼容。
仅在 modalities 为非空 list 时才启用过滤和修复逻辑。

- _provider_supports_modality: [] 返回 True,默认支持
- _assemble_request_context_for_provider: [] 不过滤图片
- _should_fix_modalities_for_provider: [] 不触发历史上下文修复
- _func_tool_for_provider: [] 不清除工具

复现脚本已确认 Bug 不再复现,82 个相关单元测试全部通过。

* fix(core): 补充修复 tool loop 中 cached images 的 modalities 判断

上一笔 commit 遗漏了 tool_loop_agent_runner.py 第 917 行对
cached images 的 modalities 检查,当 modalities=[] 时,tool call
返回的图片不会被追加到消息中,导致模型看不到 tool 结果中的图片。

修复方式与主修复一致:not modalities or image in modalities

复现脚本和 82 个单元测试全部通过。

* test: 补充 fake_save_image mock 缺少的 mime_type 字段

修复 modalities=[] 导致 cached images 分支变为可达后,暴露
了 test_tool_result_includes_all_calltoolresult_content 中
fake_save_image mock 不完整的问题:返回的 SimpleNamespace
缺少 mime_type 属性,而实际 tool_image_cache.save_image()
始终包含该字段。

---------

Co-authored-by: C₂₂H₂₅NO₆ <Sisyphbaous-DT-Project@users.noreply.github.com>
2026-06-02 08:53:59 +08:00
2026-05-30 20:10:51 +08:00
2026-03-22 19:12:12 +08:00
2023-04-15 15:33:00 +08:00
2026-01-13 12:19:05 +08:00
2025-02-24 00:31:57 +08:00

astrbot-github-banner-v2-light-0405_副本

AstrBot is an open-source all-in-one Agent chatbot platform that integrates with mainstream instant messaging apps. It provides reliable and scalable conversational AI infrastructure for individuals, developers, and teams. Whether you're building a personal AI companion, intelligent customer service, automation assistant, or enterprise knowledge base, AstrBot enables you to quickly build production-ready AI applications within your IM platform workflows.

screenshot_1 5x_postspark_2026-02-27_22-37-45

Key Features

  1. 💯 Free & Open Source.
  2. AI LLM Conversations, Multimodal, Agent, MCP, Skills, Knowledge Base, Persona Settings, Auto Context Compression.
  3. 🤖 Supports integration with Dify, Alibaba Cloud Bailian, Coze, and other agent platforms.
  4. 🌐 Multi-Platform: QQ, WeChat Work, Feishu, DingTalk, WeChat Official Accounts, Telegram, Slack, and more.
  5. 📦 Plugin Extensions with 1000+ plugins available for one-click installation.
  6. 🛡️ Agent Sandbox for isolated, safe execution of code, shell calls, and session-level resource reuse.
  7. 💻 WebUI Support.
  8. 🌈 Web ChatUI Support with built-in agent sandbox and web search.
  9. 🌐 Internationalization (i18n) Support.

💙 Role-playing & Emotional Companionship Proactive Agent 🚀 General Agentic Capabilities 🧩 1000+ Community Plugins

99b587c5d35eea09d84f33e6cf6cfd4f

c449acd838c41d0915cc08a3824025b1

image

image

Quick Start

One-Click Deployment

For users who want to quickly experience AstrBot, are familiar with command-line usage, and can install a uv environment on their own, we recommend the uv one-click deployment method :

uv tool install astrbot --python 3.12
astrbot init # Only execute this command for the first time to initialize the environment
astrbot run

Requires uv to be installed. AstrBot requires Python 3.12 or later. The --python 3.12 option ensures that uv creates the tool environment with Python 3.12.

Note

For macOS users: due to macOS security checks, the first run of the astrbot command may take longer (about 10-20s).

Update astrbot:

uv tool upgrade astrbot --python 3.12

Warning

AstrBot deployed via uv does not support upgrading through the WebUI. To update, please run the command above from the command line.

Docker Deployment

For users familiar with containers and looking for a more stable, production-ready deployment method, we recommend deploying AstrBot with Docker / Docker Compose.

Please refer to the official documentation: Deploy AstrBot with Docker.

Deploy on RainYun

For users who want one-click deployment and do not want to manage servers themselves, we recommend RainYun's one-click cloud deployment service ☁️:

Deploy on RainYun

Desktop Application Deployment

For users who want to use AstrBot on desktop and mainly use ChatUI, we recommend AstrBot App.

Visit AstrBot-desktop to download and install; this method is designed for desktop usage and is not recommended for server scenarios.

Launcher Deployment

For desktop users who also want fast deployment and isolated multi-instance usage, we recommend AstrBot Launcher.

Visit AstrBot Launcher to download and install.

Deploy on Replit

Replit deployment is maintained by the community and is suitable for online demos and lightweight trials.

Run on Repl.it

AUR

AUR deployment targets Arch Linux users who prefer installing AstrBot through the system package workflow.

Run the command below to install astrbot-git, then start AstrBot in your local environment.

yay -S astrbot-git

More deployment methods

If you need panel-based management or deeper customization, see BT-Panel Deployment for BT Panel app-store setup, 1Panel Deployment for 1Panel app-market deployment, CasaOS Deployment for NAS/home-server visual deployment, and Manual Deployment for fully custom source-based installation with uv.

Supported Messaging Platforms

Connect AstrBot to your favorite chat platform.

Platform Maintainer
QQ Official
OneBot v11 protocol implementation Official
Telegram Official
Wecom & Wecom AI Bot Official
WeChat Official Accounts Official
Feishu (Lark) Official
DingTalk Official
Slack Official
Discord Official
LINE Official
Satori Official
KOOK Official
Misskey Official
Mattermost Official
WhatsApp (Coming Soon) Official
Matrix Community
Rocket.Chat Community
VoceChat Community

Supported Model Services

Service Type
OpenAI and Compatible Services LLM Services
Anthropic LLM Services
Google Gemini LLM Services
Moonshot AI LLM Services
Zhipu AI LLM Services
DeepSeek LLM Services
Ollama (Self-hosted) LLM Services
LM Studio (Self-hosted) LLM Services
AIHubMix LLM Services (API Gateway, supports all models)
CompShare LLM Services
302.AI LLM Services
TokenPony LLM Services
SiliconFlow LLM Services
PPIO Cloud LLM Services
ModelScope LLM Services
OneAPI LLM Services
Dify LLMOps Platforms
Alibaba Cloud Bailian Applications LLMOps Platforms
Coze LLMOps Platforms
OpenAI Whisper Speech-to-Text Services
SenseVoice Speech-to-Text Services
Xiaomi MiMo Omni Speech-to-Text Services
OpenAI TTS Text-to-Speech Services
Gemini TTS Text-to-Speech Services
GPT-Sovits-Inference Text-to-Speech Services
GPT-Sovits Text-to-Speech Services
FishAudio Text-to-Speech Services
Edge TTS Text-to-Speech Services
Alibaba Cloud Bailian TTS Text-to-Speech Services
Azure TTS Text-to-Speech Services
Minimax TTS Text-to-Speech Services
Xiaomi MiMo TTS Text-to-Speech Services
Volcano Engine TTS Text-to-Speech Services

❤️ Sponsors

sponsors

❤️ Contributing

Issues and Pull Requests are always welcome! Feel free to submit your changes to this project :)

How to Contribute

You can contribute by reviewing issues or helping with pull request reviews. Any issues or PRs are welcome to encourage community participation. Of course, these are just suggestions—you can contribute in any way you like. For adding new features, please discuss through an Issue first.

Development Environment

AstrBot uses ruff for code formatting and linting.

git clone https://github.com/AstrBotDevs/AstrBot
pip install pre-commit
pre-commit install

🌍 Community

QQ Groups

  • Group 12: 916228568 (New)

  • Group 9: 1076659624 (Full)

  • Group 10: 1078079676 (Full)

  • Group 11: 704659519 (Full)

  • Group 1: 322154837 (Full)

  • Group 3: 630166526 (Full)

  • Group 4: 1077826412 (Full)

  • Group 5: 822130018 (Full)

  • Group 6: 753075035 (Full)

  • Group 7: 743746109 (Full)

  • Group 8: 1030353265 (Full)

  • Developer Group(Chit-chat): 975206796

  • Developer Group(Formal): 1039761811

Discord Server

Discord_community

❤️ Special Thanks

Special thanks to all Contributors and plugin developers for their contributions to AstrBot ❤️

Additionally, the birth of this project would not have been possible without the help of the following open-source projects:

Star History

Tip

If this project has helped you in your life or work, or if you're interested in its future development, please give the project a Star. It's the driving force behind maintaining this open-source project <3

Star History Chart

Companionship and capability should never be at odds. What we aim to create is a robot that can understand emotions, provide genuine companionship, and reliably accomplish tasks.

私は、高性能ですから!

Description
No description provided
Readme AGPL-3.0 141 MiB
Languages
Python 61.2%
Vue 19.5%
JavaScript 13.6%
TypeScript 4.8%
HTML 0.3%
Other 0.6%