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.
fix(agent): process all content items in CallToolResult, not just the first
sync master-﹥dev
feat: add OneBot V11 file API support for sending files
feat: add clone persona functionality
…95987/AstrBot into fix-修正shell工具未正确应用工具调用超时的问题
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Fix 修正shell工具未正确应用工具调用超时的问题
- Implement 'astrbot uninstall' to remove systemd service and data files - Add '--log-level' option to 'astrbot run' (default: INFO) - Pass log level config to core logger via env var
- Introduce 'astrbot bk' command with GPG signing, encryption, and digest support - Add import/export functionality using core backup modules - Refactor path management to use 'AstrbotPaths' singleton across CLI commands - Replace blocking subprocess calls with asyncio.create_subprocess_exec in backup command - Add comprehensive tests for uninstall and backup commands - Improve module resource handling for bundled dashboard assets
- shell.py: Replace undefined TContext with AstrAgentContext - context.py: Add missing Coroutine import from typing - lsp/client.py: cleanup (already applied)
- Add test_lsp_client_send_request_not_connected - Add test_lsp_client_send_notification_not_connected - Mark 6.2 and 7.2 tasks complete in tasks.md
- Add _message_count and _last_activity_timestamp to orchestrator - Add record_activity() method to orchestrator - Add name field to get_protocol_status returns - Add total_messages and last_activity to get_stats - Update tests to verify new fields
The internal ToolSet (base.py) was missing add_tool() and merge() methods that the agent code expects. When tmgr.get_full_tool_set() returned a base.py ToolSet, calls to add_tool() and merge() failed. Added: - add_tool() as alias to add() - merge() method to merge another ToolSet This fixes runtime crash: AttributeError: 'ToolSet' object has no attribute 'add_tool'
- Core orchestrator with star registration - Runtime stats tracking - Message types - Python bindings via pyo3 - No unsafe, strict clippy
Previously initialize_runtime_bootstrap() was called at module level, causing it to run for ALL astrbot CLI commands (conf admin, etc). Now it only runs when the 'run' command is executed.
Also show password hash values instead of masking in conf set output.
When clients disconnect abruptly, hypercorn raises ssl.SSLError APPLICATION_DATA_AFTER_CLOSE_NOTIFY during SSL shutdown. This is benign and expected behavior. Wrap serve() with try/except to suppress these spurious errors.
When ASTRBOT_BUILD_DASHBOARD is not set, the hatch build hook now creates an empty target dir with a .placeholder file so the artifacts glob matches and hatchling does not fail.
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
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.