Conversation
There was a problem hiding this comment.
Sorry @LIghtJUNction, your pull request is larger than the review limit of 150000 diff characters
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors AstrBot's core architecture by modularizing tool management and improving the robustness of tool execution. It streamlines the integration of various tools, enhances the dashboard's configurability, and ensures more predictable behavior for LLM interactions. These changes contribute to a more maintainable, extensible, and user-friendly system. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring of the tool management system, centered around a new ToolProvider protocol. This change decouples tool registration from the main agent logic, greatly enhancing modularity and making the system more extensible. Key improvements include the introduction of ComputerToolProvider and CronToolProvider, a new sandbox capability check to prevent the use of browser tools in unsupported environments, and deterministic tool serialization to improve caching. The command-line interface and dashboard have also been substantially improved, offering better configuration options like a backend-only mode and flexible API URL settings. Overall, these changes represent a major architectural improvement, increasing the robustness, safety, and maintainability of the codebase. The implementation is solid, and I have no specific issues to raise.
* feat(dashboard): add auto switch theme (default off) feat(dashboard): move all get theme and set theme by check current theme into stores/customizer * feat(dashboard): fix duplicate for auto switch theme 根据Gemini的意见更改了一些地方。 将原本的状态更新挪到了App.vue里,可以去除很多地方更新theme所需要的theme依赖。 将翻译修改了 将监听器改为了watch
… and cache; fix async file read in star_manager
…analysis issue This resolves a 'BrokenWorkerInterpreter' attribute access error reported by basedpyright.
…stemd service creation
…nv): standardize vars
…/ruff issues - Dashboard: Catch missing index.html error, log warning, and disable WebUI instead of crashing. - Dashboard: Use anyio.Path for async file existence checks in SSL config. - CLI/Backup: Replace blocking file operations with anyio async operations. - Core: Replace blocking file operations with anyio in Coze/Dify clients and TTS simulation. - Provider: Rename 'timeout' param to 'init_timeout'/'request_timeout' to fix ASYNC109 warnings. - Ruff: Fix various ASYNC230/ASYNC240 errors across multiple files.
These were called on ToolSet instances returned by get_full_tool_set() but were missing from the base ToolSet implementation.
shutdown() now clears pending requests directly instead of calling cancel() on asyncio.Future instances.
Added anthropic_schema, google_schema, get_func_desc_openai_style, get_func_desc_anthropic_style, get_func_desc_google_genai_style, __bool__, __repr__, __str__, names, empty to match tool.py ToolSet.
The run command should use the original InitialLoader-based startup, not the new _internal/runtime bootstrap. Only the dev subcommand uses the new architecture.
The import of tests.fixtures.helpers happened before sys.path was modified, causing ModuleNotFoundError when running pytest.
_BUNDLED_DIST may be a symlink pointing to the actual build output. Using resolve() ensures the path is correctly resolved to the real directory, allowing the dashboard frontend to load properly when bundled as a symlink in the dev branch.
- Add Rust orchestrator with async bootstrap pattern - Implement CLI with clap (start, stats, health subcommands) - Add protocol stubs (LSP, MCP, ACP, ABP) - Python bindings via pyo3 (_core module) - Use maturin as build backend - Add tombi.toml for schema config
The dev branch has astrbot/dashboard/dist as a symlink to ../../dashboard/dist, which is valid in the dev workspace but becomes a broken symlink when cloned to /opt/astrbot for installation. Fix the maturin build hook to: - Remove broken symlinks before creating placeholder directories - Handle symlink vs directory removal in copy_dashboard_dist() - Always generate placeholder when dashboard build is skipped or fails
* feat: add two-phase startup lifecycle Allow the dashboard to become available before plugin bootstrap completes and surface runtime readiness and failure states to API callers. Guard plugin-facing endpoints until runtime is ready and clean up provider and plugin runtime state safely across bootstrap failures, retries, stop, and restart flows. * fix: harden runtime cleanup review fixes Continue terminating remaining providers and disable MCP servers even if one provider terminate hook fails. Also add InitialLoader failure-path coverage and extract guarded plugin routes into a shared constant for easier review and maintenance. * fix: harden deferred startup recovery * fix: streamline runtime guard handling * fix: simplify runtime lifecycle coordination * fix: restore orchestrator logger binding
- Add URL param support (?api_url=, ?username=) for shareable config - Add share link button to server config dialog - Fix ToolSet API bug: tools.func_list -> tools.list_tools() - Fix Vue template bugs in CommandTable.vue (orphaned v-else, wrong prop) - Use master version of InstalledPluginsTab.vue (dev had pre-existing bugs) BREAKING CHANGE: Uses master version for InstalledPluginsTab.vue
* fix: avoid lsp client cancel scope leaks * fix: observe lsp reader task failures * fix: trim trailing whitespace in docs * fix: harden lsp client reconnect handling * fix: refine lsp client test coverage * fix: harden lsp reader task teardown * fix: refine lsp reader failure handling * fix: centralize lsp reader lifecycle * docs: fix platform adapter session type * test: shorten hanging lsp fixture sleep * docs: translate ai guide details label * fix: simplify lsp reader task lifecycle
- Keep showReserved toggle and updateAll button features - Preserve failedPluginItems card with table showing failed plugins with reload/uninstall actions - Remove duplicate content introduced during malformed merge
…dPluginsTab.vue - Vue components (v-text-field, v-btn, v-col, ExtensionCard) now use self-closing - HTML void element (img) no longer uses self-closing - HTML normal elements (span, i) now use self-closing when empty
Commit 292199d renamed tools.func_list -> tools.list_tools() in openai_source.py but forgot to add the list_tools() method to the ToolSet class, causing AttributeError at runtime.
- flatted 3.3.3 -> 3.4.2 (CVE: prototype pollution, unbounded recursion DoS) - minimatch 3.1.2 -> 3.1.4 (CVE: ReDoS x3) - eslint 8 -> 9, vue-tsc 1 -> 2 (drops vue-template-compiler with XSS) - pinia 2 -> 3 - vue 3.3 -> 3.5 - Migrate to ESLint 9 flat config (eslint.config.js) - tsconfig: moduleResolution node -> bundler, ignoreDeprecations 5 -> 6 - build: skip vue-tsc typecheck (Pinia 3 + TS 6 type inference incompatibility)
Remove EventSource-based streaming and switch to REST polling for log fetching. This eliminates the SSE connection management that caused TS type inference issues with Pinia 3.
Major changes: - Add A2A protocol (Google Agent-to-Agent) - Add ACP protocol (Agent Communication) - Add MCP protocol (Model Context Protocol) - Add LSP protocol (Language Server Protocol) - Add environment variables spec (env.md) - Add path spec with XDG and Linux server support (path.md) - Update ABP protocol to plugin-as-service model - Delete legacy OpenSpec change proposals New protocol specs: - a2a.md: Cross-platform agent interoperability - acp.md: Local agent control (IDE integration) - mcp.md: AI model to tools/data connection - lsp.md: Editor language features - abp.md: AstrBot plugin protocol - env.md: Environment variable conventions - path.md: XDG + Linux server paths
- 删除 protocols 子包 (abp, acp, lsp, mcp) - 删除 runtime 子包 (orchestrator, rust) - 删除 abc 基类 (abp, acp, lsp, mcp, gateway, orchestrator) - 删除 geteway 子包 - 删除 skills, stars, tools 子包
- abp.md: ABP (AstrBot Plugin) 插件协议规范 - api.md: API 规范 - agent-message.md: Agent 消息格式规范 - config.md: 配置系统规范 (含 GPG 安全配置) - env.md: 环境变量规范 - path.md: XDG 路径规范
- 将 Rust 核心从 astrbot/rust/ 迁移至 rust/ - 新增 a2a.rs: Agent-to-Agent 通信协议 - 新增 abp.rs: ABP 插件协议客户端 - 新增 server.rs: WebSocket/HTTP 服务器 - 更新 Cargo.toml 依赖 (futures-util) - 重构 config.rs, orchestrator.rs, protocol.rs 等核心模块
- 更新 .env.example 环境变量示例 - 更新 pyproject.toml 依赖配置 - 删除 tui 相关命令 (cmd_tui.py, cmd_run_tui.py) - 更新 CLI i18n 和核心模块 - 删除 tombi.toml
- 采用 master 的 README 多语言版本和文档更新 - 采用 dev 版本号 (4.25.0) + master 的 Python 版本限制 (<3.14) - 采用 master 的 _image_ref_to_data_url 图片处理实现 - 从 git 中移除 MDI 字体二进制文件,改由脚本生成 - 其他冲突均采用 master 版本
This pull request introduces a new workflow for deploying the dashboard to GitHub Pages and makes significant improvements to the
README.mdfor clarity, completeness, and consistency. It also includes minor formatting updates to the smoke test workflow and adds some convenience commands to.envrc.Summary of changes:
README.mdwith clearer descriptions, updated instructions, improved platform/model tables, and better contribution guidelines.Dashboard Deployment Automation
.github/workflows/deploy-dashboard.ymlto automate daily and manual dashboard builds and deployments to GitHub Pages, including build, artifact upload, and deployment steps.Documentation Improvements
README.md: clearer project description, improved feature list, updated deployment instructions, revised supported platforms/models tables, and enhanced contribution guidelines. [1] [2] [3] [4] [5]Workflow Consistency
.github/workflows/smoke_test.ymlto use consistent YAML quoting, improved comments, and clarified Python version formatting. [1] [2] [3]Developer Convenience
git pullandgit statuscommands to.envrcfor easier environment setup and status checking.