Skip to content

dev#6325

Draft
LIghtJUNction wants to merge 334 commits intomasterfrom
dev
Draft

dev#6325
LIghtJUNction wants to merge 334 commits intomasterfrom
dev

Conversation

@LIghtJUNction
Copy link
Member

@LIghtJUNction LIghtJUNction commented Mar 15, 2026

This pull request introduces a new workflow for deploying the dashboard to GitHub Pages and makes significant improvements to the README.md for 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:

  • Adds a GitHub Actions workflow for automated dashboard deployment.
  • Revamps the README.md with clearer descriptions, updated instructions, improved platform/model tables, and better contribution guidelines.
  • Minor workflow formatting and comment changes for consistency.

Dashboard Deployment Automation

  • Added .github/workflows/deploy-dashboard.yml to automate daily and manual dashboard builds and deployments to GitHub Pages, including build, artifact upload, and deployment steps.

Documentation Improvements

  • Major rewrite and expansion of 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

  • Updated .github/workflows/smoke_test.yml to use consistent YAML quoting, improved comments, and clarified Python version formatting. [1] [2] [3]

Developer Convenience

  • Added git pull and git status commands to .envrc for easier environment setup and status checking.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @LIghtJUNction, your pull request is larger than the review limit of 150000 diff characters

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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

  • Modular Tool Management: Introduced a decoupled tool provider mechanism (ToolProvider, ToolProviderContext) for enhanced extensibility and centralized tool definitions, moving away from hardcoded tool imports.
  • Improved Dashboard Integration & CLI: Enhanced CLI dashboard setup with user prompts for WebUI installation, consistent dashboard paths under the data directory, and new CLI flags/environment variables for backend-only mode.
  • Enhanced Tool Execution Safety & Determinism: Added sandbox capability checks for browser tools to prevent accidental invocation, implemented a normalize method in ToolSet for consistent LLM cache hits, and introduced a source attribute to FunctionTool for better WebUI display.
  • Refined Agent Streaming & Messaging: Improved streaming output handling in run_agent to filter and yield only relevant message components, and updated prompts/system messages for clarity in background task results.
Changelog
  • .gitignore
    • Added .serena to the ignore list and bun.lock, pmpm-lock.yaml for frontend development.
  • .python-version
    • Ensured the file ends with a newline character.
  • astrbot/cli/commands/cmd_init.py
    • Modified the initialization process to prompt users for WebUI installation and updated the dashboard check to use the root path.
  • astrbot/cli/commands/cmd_run.py
    • Added --host and --backend-only CLI options for dashboard control and integrated DASHBOARD_ENABLE environment variable.
  • astrbot/cli/utils/basic.py
    • Updated dashboard download and extraction paths to be consistently under the data directory.
  • astrbot/core/agent/mcp_client.py
    • Added a source attribute with value 'mcp' to MCPTool for tool origin tracking.
  • astrbot/core/agent/tool.py
    • Introduced a source attribute to FunctionTool to indicate its origin (plugin, internal, mcp) and added a normalize method to ToolSet for deterministic tool serialization.
  • astrbot/core/astr_agent_run_util.py
    • Implemented _extract_final_streaming_chain to filter streaming message components and integrated it into run_agent for llm_result processing.
  • astrbot/core/astr_agent_tool_exec.py
    • Refactored tool acquisition to use the new ComputerToolProvider, added a sandbox capability check for browser-related tools, and corrected a typo in a background task message.
  • astrbot/core/astr_main_agent.py
    • Removed direct imports of numerous tools and platform module, integrated ToolProvider for dynamic tool injection, updated prompt templates, and added logic to disable streaming for webchat image output.
  • astrbot/core/astr_main_agent_resources.py
    • Removed the file, relocating its contents to dedicated modules for better modularity.
  • astrbot/core/computer/booters/base.py
    • Defined abstract methods get_default_tools, get_tools, get_system_prompt_parts for tool and prompt provision in computer booters.
  • astrbot/core/computer/booters/boxlite.py
    • Added logging for file operations and health checks, and implemented get_default_tools for Boxlite booter.
  • astrbot/core/computer/booters/constants.py
    • Added constants for different booter types (BOOTER_SHIPYARD, BOOTER_SHIPYARD_NEO, BOOTER_BOXLITE).
  • astrbot/core/computer/booters/shipyard.py
    • Added logging for sandbox operations and implemented get_default_tools for Shipyard booter.
  • astrbot/core/computer/booters/shipyard_neo.py
    • Added logging for sandbox operations, implemented _base_tools, _browser_tools, get_default_tools, get_tools, and get_system_prompt_parts for Shipyard Neo booter.
  • astrbot/core/computer/computer_client.py
    • Introduced unified API functions (get_sandbox_tools, get_sandbox_capabilities, get_default_sandbox_tools, get_sandbox_prompt_parts) for querying computer tools and prompts, and improved logging for Bay credentials discovery.
  • astrbot/core/computer/computer_tool_provider.py
    • Added a new module to provide computer-use tools (local/sandbox) based on session context, encapsulating tool injection logic.
  • astrbot/core/computer/prompts.py
    • Added a new module to store booter-specific system prompt fragments like Neo file path rules and skill lifecycle prompts.
  • astrbot/core/computer/tools/neo_skills.py
    • Updated the payload parameter schema for CreateSkillPayloadTool to allow array items.
  • astrbot/core/cron/cron_tool_provider.py
    • Added a new module to provide cron job management tools following the ToolProvider protocol.
  • astrbot/core/cron/manager.py
    • Updated imports for prompt constants and integrated ComputerToolProvider into MainAgentBuildConfig for cron-woke agents.
  • astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py
    • Integrated decoupled ToolProvider instances (ComputerToolProvider, CronToolProvider) into the internal agent sub-stage initialization.
  • astrbot/core/provider/func_tool_manager.py
    • Added _INTERNAL_TOOL_PROVIDERS list and register_internal_tools method to register built-in tools from various providers.
  • astrbot/core/provider/sources/gemini_source.py
    • Modified _prepare_query_config to explicitly pass streaming flag, ensuring image modalities are downgraded for streaming requests.
  • astrbot/core/star/context.py
    • Added a call to register_internal_tools in the Context initialization to ensure built-in tools are registered.
  • astrbot/core/tool_provider.py
    • Added a new module defining the ToolProvider protocol and ToolProviderContext for decoupled tool injection.
  • astrbot/core/tools/cron_tools.py
    • Added a get_all_tools function to return all cron-related tools for registration.
  • astrbot/core/tools/kb_query.py
    • Added a new module for knowledge base query tool and retrieval logic, extracted from astr_main_agent_resources.py.
  • astrbot/core/tools/prompts.py
    • Added a new module to consolidate system prompt constants previously scattered across astr_main_agent_resources.py.
  • astrbot/core/tools/send_message.py
    • Added a new module for the SendMessageToUserTool, extracted from astr_main_agent_resources.py.
  • astrbot/core/utils/io.py
    • Added asyncio and ipaddress imports, implemented get_public_ip_address, and updated get_local_ip_addresses to handle IPv6 addresses.
  • astrbot/dashboard/routes/init.py
    • Imported LiveChatRoute, T2iRoute, Response, and RouteContext to expand dashboard routing capabilities.
  • astrbot/dashboard/routes/chat.py
    • Removed the _poll_webchat_stream_result function, indicating a change in how webchat streaming results are handled.
  • astrbot/dashboard/routes/route.py
    • Added asdict import and a to_json method to the Response dataclass for consistent JSON serialization.
  • astrbot/dashboard/routes/static_file.py
    • Added a check to prevent re-registering the index route if it already exists.
  • astrbot/dashboard/routes/tools.py
    • Enhanced tool listing to display the source attribute and prevented manual toggling of internal tools.
  • astrbot/dashboard/server.py
    • Refactored server initialization, added quart_cors for CORS handling, introduced ALLOWED_ENDPOINT_PREFIXES for authentication bypass, and improved logging for server startup/shutdown.
  • dashboard/.gitignore
    • Added bun.lock and pmpm-lock.yaml to the ignore list.
  • dashboard/env.d.ts
    • Added a declare module '*.vue' entry for better Vue component type inference.
  • dashboard/package.json
    • Moved overrides configuration from pnpm to the root level.
  • dashboard/public/config.json
    • Added a new configuration file for API base URL and presets.
  • dashboard/src/components/chat/LiveMode.vue
    • Updated WebSocket URL construction to dynamically use axios.defaults.baseURL.
  • dashboard/src/components/chat/StandaloneChat.vue
    • Disabled chat input when streaming and updated file handling for handleFileSelect.
  • dashboard/src/components/extension/componentPanel/components/ToolTable.vue
    • Added visual indicators and logic to differentiate and manage internal tools in the tool table.
  • dashboard/src/components/extension/componentPanel/types.ts
    • Added a source property to the ToolItem interface.
  • dashboard/src/i18n/locales/en-US/core/header.json
    • Added 'Log Out' translation.
  • dashboard/src/i18n/locales/en-US/features/auth.json
    • Added 'Server Configuration' translations.
  • dashboard/src/i18n/locales/en-US/features/settings.json
    • Added new translation keys for network proxy, server address, theme styles, reset options, and logout, and updated API key expiry options.
  • dashboard/src/i18n/locales/en-US/features/welcome.json
    • Added 'Configure Backend URL' step to the onboarding process.
  • dashboard/src/i18n/locales/zh-CN/core/header.json
    • Added '退出登录' translation.
  • dashboard/src/i18n/locales/zh-CN/features/auth.json
    • Added '服务器配置' translations.
  • dashboard/src/i18n/locales/zh-CN/features/settings.json
    • Added new translation keys for网络代理, 服务器地址, 主题样式, 恢复默认, and 退出登录, and updated API key expiry options.
  • dashboard/src/i18n/locales/zh-CN/features/welcome.json
    • Added '配置后端地址' step to the onboarding process.
  • dashboard/src/layouts/full/vertical-header/VerticalHeader.vue
    • Refactored header layout for desktop and mobile, added a logout button, and updated view mode toggle logic.
  • dashboard/src/main.ts
    • Implemented dynamic loading of config.json for API base URL and presets, and integrated useApiStore for global API configuration.
  • dashboard/src/stores/api.ts
    • Added a new Pinia store to manage API base URL, configuration presets, and custom presets.
  • dashboard/src/views/Settings.vue
    • Refactored API key management to use new API endpoints, integrated API store for server configuration, and updated theme color management.
  • dashboard/src/views/WelcomePage.vue
    • Added a new onboarding step for configuring the backend API address, including validation and saving functionality.
  • dashboard/src/views/authentication/auth/LoginPage.vue
    • Integrated API store for server configuration and presets, allowing users to configure the backend URL from the login page.
  • dashboard/tsconfig.json
    • Updated TypeScript compiler options for better compatibility and strictness.
  • dashboard/tsconfig.vite-config.json
    • Updated TypeScript compiler options for Vite configuration.
  • dashboard/vite.config.ts
    • Updated the development server host to :: for IPv6 support and adjusted chunkSizeWarningLimit.
  • docs/refactor-neo-decouple.md
    • Added a new documentation file detailing the refactoring plan for Neo tool decoupling.
  • pyproject.toml
    • Added quart-cors to project dependencies.
  • tests/test_booter_decoupling.py
    • Added new TDD tests to verify the booter decoupling refactoring, covering constants, base interfaces, and booter-specific tool declarations.
  • tests/test_computer_config.py
    • Renamed _discover_bay_credentials to discover_bay_credentials and updated related test cases.
  • tests/test_profile_aware_tools.py
    • Updated test patches to align with the new tool provisioning logic in astr_main_agent.
  • tests/test_tool_loop_agent_runner.py
    • Added MockFinalMediaStreamProvider and a test case to ensure run_agent correctly emits final media chains in streaming mode.
  • tests/unit/test_astr_main_agent.py
    • Added tests for disabling streaming for webchat image output based on provider configuration and model metadata, and removed os.environ checks for shipyard configuration.
  • tests/unit/test_gemini_source.py
    • Added new unit tests for ProviderGoogleGenAI to verify correct handling of image modalities in streaming and non-streaming requests.
  • tests/unit/test_internal_agent_sub_stage.py
    • Added new unit tests for InternalAgentSubStage to verify its use of the effective streaming flag and agent runner initialization.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

kyangconn and others added 17 commits March 17, 2026 19:06
* 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.
…/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.
LIghtJUNction and others added 30 commits March 24, 2026 20:48
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 版本
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend area:webui The bug / feature is about webui(dashboard) of astrbot. enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants