dev#6325
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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| return True | ||
| with socket.socket(family, socket.SOCK_STREAM) as s: | ||
| s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
| s.bind((host, port)) |
Check warning
Code scanning / CodeQL
Binding a socket to all network interfaces Medium
This autofix suggestion was applied.
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
General fix approach: never bind the probe socket to wildcard addresses (0.0.0.0, ::, or empty host). Instead, normalize wildcard/unspecified hosts to loopback for the preflight check (127.0.0.1 for IPv4, ::1 for IPv6). This preserves functionality (checking whether the port is in use) while removing the all-interfaces bind pattern.
Best single fix in this file:
- Edit
astrbot/dashboard/server.pyincheck_port_in_use. - Before choosing
familyand binding, derive aprobe_hostfromhost:""or"0.0.0.0"→"127.0.0.1""::"→"::1"- otherwise unchanged.
- Use
probe_hostfor family detection andbind. - Keep existing logging/exception behavior intact.
No new imports or dependencies are needed.
| @@ -603,11 +603,17 @@ | ||
|
|
||
| def check_port_in_use(self, host: str, port: int) -> bool: | ||
| """跨平台检测端口是否被占用""" | ||
| family = socket.AF_INET6 if ":" in host else socket.AF_INET | ||
| probe_host = host | ||
| if host in ("", "0.0.0.0"): | ||
| probe_host = "127.0.0.1" | ||
| elif host == "::": | ||
| probe_host = "::1" | ||
|
|
||
| family = socket.AF_INET6 if ":" in probe_host else socket.AF_INET | ||
| try: | ||
| with socket.socket(family, socket.SOCK_STREAM) as s: | ||
| s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
| s.bind((host, port)) | ||
| s.bind((probe_host, port)) | ||
| return False | ||
| except OSError as exc: | ||
| if exc.errno == errno.EADDRINUSE: |
- Updated the VitePress configuration to include links to CLI commands in both English and Chinese. - Enhanced the AstrBot deployment documentation with instructions for installing it as a system service. - Created comprehensive CLI commands documentation covering initialization, service management, configuration, and plugin management. - Added tests for CLI command aliases and service functionalities to ensure proper command registration and behavior. - Implemented service log management features, including enabling application logging and controlling log visibility.
# Conflicts: # astrbot/builtin_stars/astrbot/main.py # astrbot/cli/__main__.py # astrbot/cli/commands/__init__.py # astrbot/core/provider/sources/openai_source.py
…nhance task XML configuration
a4c4a7d to
9bd38ca
Compare
# Conflicts: # astrbot/core/astr_main_agent.py # astrbot/core/db/__init__.py # astrbot/core/db/vec_db/faiss_impl/document_storage.py # astrbot/core/message/components.py # astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py # astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py # astrbot/core/platform/sources/qqofficial/qqofficial_platform_adapter.py # astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py # astrbot/core/provider/sources/anthropic_source.py # astrbot/core/provider/sources/openai_source.py # astrbot/dashboard/routes/command.py # astrbot/dashboard/routes/static_file.py # astrbot/dashboard/server.py # dashboard/package.json # dashboard/src/components/chat/ChatInput.vue # dashboard/src/components/chat/ChatMessageList.vue # dashboard/src/components/chat/MessageList.vue # dashboard/src/components/chat/StandaloneChat.vue # dashboard/src/components/chat/message_list_comps/ReasoningBlock.vue # dashboard/src/components/provider/ProviderSourcesPanel.vue # dashboard/src/components/shared/ExtensionCard.vue # dashboard/src/components/shared/ListConfigItem.vue # dashboard/src/composables/useProviderSources.ts # dashboard/src/utils/providerUtils.js # dashboard/src/views/extension/InstalledPluginsTab.vue # docs/zh/dev/star/plugin.md
… network interfaces Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Resolved. I merged |
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.masterchanges into this branch.__proto__,prototype,constructor) indashboard/src/components/shared/AstrBotConfigV4.vue.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.Post-feedback Updates
master.AstrBotConfigV4.vue.