Commit Graph

5192 Commits

Author SHA1 Message Date
LIghtJUNction
dcaaf6286a test: comprehensive test coverage and type fixes
- Add 100+ new test files covering provider sources, platform adapters,
  agent runners, star/plugin system, knowledge base, core utils,
  pipeline, computer tools, builtin commands, and dashboard routes
- Fix Python type errors in sqlite.py (col() wrappers for SQLModel),
  astr_agent_tool_exec, core_lifecycle, star context/manager
- Fix TypeScript strict mode errors across 30+ dashboard Vue files
- Add import smoke tests, auth roundtrip, startup tests
- Add compile-all check and CLI entry test for AUR compatibility
- Restore BotMessageAccumulator and helpers lost in merge
2026-04-29 06:29:56 +08:00
LIghtJUNction
a0c9cc8fe3 fix: test_api.py type errors - inline kwargs, fix ParameterSet import, add json=None 2026-04-29 04:38:03 +08:00
LIghtJUNction
d8eb3d3869 fix: dashboard_shutdown_event None safety, missing KnowledgeBaseUploadError import, core_lifecycle imports and type errors 2026-04-29 04:35:06 +08:00
LIghtJUNction
10fa16e0b8 fix: core_lifecycle event_bus cleanup, initialize_core sets dashboard_shutdown_event, load_pipeline_scheduler mock 2026-04-29 04:31:16 +08:00
LIghtJUNction
b4034225b8 test: cover all non-placeholder API routes with parametrized smoke tests 2026-04-29 04:26:58 +08:00
LIghtJUNction
1bc8175f69 fix: make registered_web_apis/_register_tasks instance vars, add reset_runtime_registrations
Class-level list vars caused cross-instance sharing. Tests expecting
isolated registration containers failed. Move to __init__ and add the
reset_runtime_registrations helper that tests depend on.
2026-04-29 04:26:42 +08:00
LIghtJUNction
d6c4c70369 fix: add missing functools and TYPE_CHECKING imports in shipyard.py 2026-04-29 04:24:57 +08:00
LIghtJUNction
d3793ee28c fix: align test_initial_loader with current InitialLoader.start implementation
InitialLoader.start now calls lifecycle.initialize() (not initialize_core).
Updated test mocks and assertions accordingly. 3 tests remain that assume
a split-phase bootstrap_runtime call that no longer exists in the current
InitialLoader.
2026-04-29 04:20:35 +08:00
LIghtJUNction
4480bc20ac fix: test_ensure_vec_db mock path and create kb_dir to avoid SQLite error 2026-04-29 04:18:18 +08:00
LIghtJUNction
585b871492 test: add dashboard API smoke tests for all route classes 2026-04-29 04:16:20 +08:00
LIghtJUNction
afb0f88342 fix: test_cua_config_log logger mock compat with multi-arg info calls 2026-04-29 04:16:13 +08:00
LIghtJUNction
3fb7515e23 fix: LocalShellComponent tests - mock sessions to avoid event loop conflicts
Real bash subprocess via PersistentShellSession binds stdin/stdout to the
creating event loop. pytest-asyncio's per-function loop switching caused
'Future attached to a different loop' errors. Mock the session instead.

Also remove the unused session-level cleanup fixture and patch.
2026-04-29 04:15:02 +08:00
LIghtJUNction
cafe26b154 fix: repair test failures from merge
- test_astr_agent_tool_exec: add get_llm_tool_manager mock to handoff tests
- test_astr_main_agent: fix fullwidth punctuation, Firecrawl->Tavily, streaming
  test, CUA/shipyard sandbox tests, add get_llm_tool_manager mock
- shipyard_neo/browser.py: add @builtin_tool to BrowserExecTool/BatchExecTool/RunBrowserSkillTool
- shipyard_neo/neo_skills.py: add @builtin_tool to all 11 NeoSkillToolBase subclasses
2026-04-29 04:04:08 +08:00
LIghtJUNction
e9a62f7758 test: align imports with PKGBUILD check(), add AUR startup chain tests 2026-04-29 03:47:58 +08:00
LIghtJUNction
71ce6b044a test: add compile-all check and CLI entry point test for AUR compat 2026-04-29 03:45:34 +08:00
LIghtJUNction
846a1ab1a7 test: add main.py syntax check and SQLiteDatabase abstract method check 2026-04-29 03:42:12 +08:00
LIghtJUNction
0c47c27e4b test: add import smoke, auth roundtrip, and startup tests
- test_imports: catch missing symbols and abstract methods
- test_auth: argon2id roundtrip, password validation, login challenge
- test_startup: verify core modules import without crashing
fix: restore BotMessageAccumulator and helpers lost in cherry-pick
2026-04-29 03:39:27 +08:00
LIghtJUNction
1d36f04e1c fix: restore _sanitize_upload_filename function lost in merge
This function was dropped during merge, causing ImportError in
test_upload_filename_sanitization.py and breaking upload handling.
Re-implemented with null-byte removal, path traversal stripping,
fakepath prefix removal, and empty-fallback to UUID.
2026-04-29 03:38:37 +08:00
LIghtJUNction
50b1485f89 fix: add 5 missing SQLiteDatabase method implementations lost in merge
BaseDatabase added 5 new abstract methods (list_sdk_platform_message_history,
delete_platform_message_before, delete_platform_message_after,
delete_all_platform_message_history, find_platform_message_history_by_idempotency_key)
but SQLiteDatabase did not implement them, causing TypeError on startup.

All methods follow the existing codebase patterns using async SQLAlchemy sessions
with the delete/select helpers.
2026-04-29 03:33:35 +08:00
LIghtJUNction
4925397542 fix: restore IME fix, fileTypeStyles, clearStaged fix lost in inline edit merge 2026-04-29 03:14:46 +08:00
LIghtJUNction
e610c49499 fix: port IME enter fix and Firecrawl tool name from master
# Conflicts:
#	dashboard/src/components/chat/ChatInput.vue
2026-04-29 03:10:23 +08:00
LIghtJUNction
716e651d80 feat: add inline message editing and regeneration functionality for webui (#7673)
* feat: add inline message editing and regeneration functionality for webui

- Implemented inline editing for user messages in the chat component.
- Added a regenerate menu for retrying messages with different models.
- Enhanced message handling to include llm_checkpoint_id for better tracking.
- Updated localization files to include new actions for retrying and model selection.
- Introduced tests for checkpoint message handling and chat route functionality.

* feat: thread mode in webui

* feat: enhance message editing functionality to allow only the latest user message to be edited

* feat: add error handling and user feedback for thread creation in chat component

* feat: add thread count display and localization support in chat component

* feat: add RefsSidebar component and integrate reference management in chat UI

* feat: improve message editing validation and cleanup for bot messages

* feat: enhance checkpoint message handling with binding and dumping functionality
# Conflicts:
#	astrbot/core/agent/message.py
#	astrbot/core/agent/runners/tool_loop_agent_runner.py
#	astrbot/core/astr_main_agent.py
#	astrbot/core/db/sqlite.py
#	astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py
#	astrbot/core/platform/sources/webchat/webchat_adapter.py
#	astrbot/dashboard/routes/chat.py
#	astrbot/dashboard/routes/live_chat.py
#	dashboard/src/components/chat/Chat.vue
#	dashboard/src/components/chat/ChatInput.vue
#	dashboard/src/components/chat/ChatMessageList.vue
#	dashboard/src/components/chat/ProviderModelMenu.vue
#	dashboard/src/components/shared/StyledMenu.vue
#	dashboard/src/composables/useMessages.ts
#	dashboard/src/i18n/locales/ru-RU/features/chat.json
2026-04-29 03:10:03 +08:00
LIghtJUNction
d57582e599 fix: restore merge-dropped port/ip_addr variable definitions and payload type ignore 2026-04-29 03:06:56 +08:00
LIghtJUNction
7c4a061578 feat: port attachment handling improvements from master
- clearStaged({ revokeUrls: false }) to preserve blob URLs during send
- File type icon helpers (fileTypeStyles, fileExtension, filePresentation)
- CSS transitions for input container and textarea
- File dedup via SHA-256 signature in useMediaHandling
2026-04-29 03:05:09 +08:00
LIghtJUNction
946685d786 fix: re-export BACKGROUND_TASK_WOKE_USER_PROMPT and CONVERSATION_HISTORY_INJECT_PREFIX from astr_main_agent_resources 2026-04-29 03:00:24 +08:00
LIghtJUNction
2c3bceb2e6 feat: add file dedup and signature check from master attachment handling 2026-04-29 03:00:13 +08:00
LIghtJUNction
9bc8731f83 fix: add Firecrawl API key and CUA image config from master 2026-04-29 02:47:51 +08:00
LIghtJUNction
c059d60f57 fix: port IME enter fix and Firecrawl tool name from master 2026-04-29 02:41:13 +08:00
LIghtJUNction
1acefcd8c7 fix: restore dashboard to pre-merge version (broken by -X theirs merge) 2026-04-29 02:32:05 +08:00
LIghtJUNction
497fefb3ca fix: restore missing sentinel classes and import lost in merge 2026-04-29 02:27:46 +08:00
LIghtJUNction
f5d60f3c7f fix: restore persistent shell session lost in merge, upgrade axios to 1.15.0 2026-04-29 02:18:08 +08:00
LIghtJUNction
0208dbb15f Merge branch 'master' of https://github.com/AstrBotDevs/AstrBot into dev
# Conflicts:
#	dashboard/vite.config.ts
2026-04-29 02:16:18 +08:00
LIghtJUNction
63e1988f86 chore: merge CLAUDE.md into AGENTS.md and remove CLAUDE.md 2026-04-29 02:15:06 +08:00
LIghtJUNction
5f827fffd2 feat: persistent shell session and remove dead ToolSessionManager
- Replace LocalShellComponent's one-shot subprocess.run() with a
  PersistentShellSession that wraps a long-running bash process per UMO.
  cd/export/source now persist naturally within a conversation.
- Support background task execution via nohup.
- Remove unused ToolSessionManager / ToolSessionState (dead code,
  never wired to any consumer).
- Fix performance benchmark: separate throughput and memory measurement
  so tracemalloc doesn't distort timing (was 7x slower).
- Optimize bool validation in CommandFilter with frozenset + isinstance
  short-circuit.
2026-04-29 02:06:24 +08:00
LIghtJUNction
4463895c89 chore: improve code quality score from 55 to 81
- Convert bad type: ignore[...] to blanket ignores
- Remove unused type: ignore directives
- Fix genie_tts/dashscope_tts Any type annotations
- Remove temp file
2026-04-29 01:28:20 +08:00
Soulter
6b36e1abac fix: comment out tool_choice parameter in ToolLoopAgentRunner for debugging
fixes: #7853
closes: #7856
closes: #7862
2026-04-29 00:20:38 +08:00
Weilong Liao
8f356b84c7 fix(core): restrict send_message_to_user to current session (security fix #7822) (#7824)
* fix(core): security fix - restrict send_message_to_user to current session only

Closes #7822

SECURITY: Remove the user-controlled 'session' parameter from the
send_message_to_user tool. Previously, a regular user could ask the
LLM to send messages to any arbitrary session (group chat) by
providing a crafted session string, which is a high-risk
vulnerability.

Changes:
- Remove 'session' parameter from tool schema (LLM can no longer
  propose it)
- Always use context.context.event.unified_msg_origin as the target
  session
- Update description to clearly state that messages can only be sent
  to the current user's session

* fix: restore session param but restrict to admin only

- Re-add the  parameter removed in the original PR
- Non-admin users can only send to their own session (current_session)
- Admin users can send to any session via the  param
- Uses  from computer_tools.util (same pattern as fs.py)
- Ref: https://github.com/AstrBotDevs/AstrBot/issues/7822

Co-authored-by: Soulter <soulter@astrbot.app>

* Update message_tools.py

---------

Co-authored-by: AstrBot <bot@astrbot.app>
2026-04-29 00:15:16 +08:00
诗浓
98b05b7e89 fix(provider): persist model enable toggle (#7865)
* fix(provider): persist model enable toggle

Fixes AstrBotDevs/AstrBot#7863

* fix(provider): wait for model toggle refresh
2026-04-28 23:55:46 +08:00
Soulter
962c299c2d feat(shell): enhance exec method to support timeout parameter and improve background command handling 2026-04-28 23:55:29 +08:00
daniel5u
66d620dab5 fix: merge anthropic parallel tool results (#7875) 2026-04-28 23:48:09 +08:00
Weilong Liao
ac7f6aa60d feat(shell): add background command execution with output redirection and timeout support (#7835)
* feat(shell): add background command execution with output redirection and timeout support

* feat(shell): update timeout parameter to be optional in shell execution methods

* feat(shell): set default timeout for shell execution to 10,000,000 milliseconds

* feat(shell): set default timeout to 300s for shell execution

* feat(shell): reorder timeout parameter in ExecuteShellTool configuration

* feat(shell): implement background command execution with detached shell command support

Co-authored-by: Copilot <copilot@github.com>

* test(shell): remove obsolete test for background shell command output redirection

* fix: reorder import statements in shell.py for consistency

* fix: wrap command in parentheses for background output redirection

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-28 23:25:54 +08:00
エイカク
2f33c34b5c fix: protect desktop plugin installs with core lock (#7872) 2026-04-28 21:10:19 +09:00
Weilong Liao
d8de0035a9 feat: add attachment saved event handling in chat and live chat routes (#7869)
Co-authored-by: Zhilan615 <2864095951@qq.com>
2026-04-28 17:14:40 +08:00
Soulter
1801834cac fix: remove BOM from install.ps1 file 2026-04-28 15:34:33 +08:00
Soulter
4d9340c216 feat: add deploy scripts for Windows and Linux installation, remove copy-deploy-cli script 2026-04-28 15:05:35 +08:00
dependabot[bot]
9016a3b2c4 chore(deps): bump pnpm/action-setup in the github-actions group (#7857)
Bumps the github-actions group with 1 update: [pnpm/action-setup](https://github.com/pnpm/action-setup).


Updates `pnpm/action-setup` from 5.0.0 to 6.0.3
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v5.0.0...v6.0.3)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-28 14:57:31 +08:00
Soulter
e4a9274b41 fix: update .gitignore and copy-deploy-cli script paths for public directory 2026-04-28 14:56:44 +08:00
EterUltimate
e218620a37 feat: add one-line deploy script (deploy-cli.sh) (#7631)
* feat: add one-line deploy script (deploy-cli.sh) and update cli.md

- Add docs/scripts/deploy-cli.sh for one-command deployment (Linux/macOS/WSL)
- Update docs/zh/deploy/astrbot/cli.md to reference local script
- Replace non-existent https://astrbot.app/deploy.sh with raw.githubusercontent.com URL
- Add local run tip and WSL-based Windows support

* fix: address PR review feedback for deploy-cli.sh

- Replace sort -V with Python-native version check (macOS BSD compat)
- Bump Python requirement from >=3.10 to >=3.12 (match pyproject.toml)
- Detect current directory as project root (avoid nested clone)
- Handle existing non-git directory explicitly
- Add curl dependency check
- Support ASTRBOT_REPO and ASTRBOT_DIR env vars for forks/mirrors
- Update cli.md version description to match

* feat: add Windows PowerShell deploy script and update docs

- Add deploy-cli.ps1 for Windows native environment (PowerShell 7+)
- Update cli.md to document Windows one-liner deployment
- Add local script execution instructions for both bash and ps1

* refactor: standardize log messages and improve clarity in various modules

Co-authored-by: Copilot <copilot@github.com>

* docs: 移除一行命令快速部署部分,简化安装说明

* feat: 添加脚本以复制部署 CLI 文件并更新构建命令

* refactor: 更新日志消息以提高可读性,统一英文提示信息

---------

Co-authored-by: Soulter <905617992@qq.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Weilong Liao <37870767+Soulter@users.noreply.github.com>
2026-04-28 14:49:50 +08:00
エイカク
cb5c172e69 feat: add CUA computer-use sandbox support (#7828)
* feat: add CUA computer-use sandbox support

* fix: add CUA config metadata translations

* fix: address CUA sandbox review feedback

* fix: default CUA sandbox to local mode

* fix: harden CUA SDK method compatibility

* fix: harden CUA GUI and permission handling

* fix: refine CUA capability and shell handling

* fix: avoid inline CUA screenshot image results by default

* fix: guide CUA browser startup workflow

* feat: add CUA browser and key press tools

* fix: launch CUA browser as sandbox user

* fix: stabilize CUA browser screenshots

* fix: simplify CUA browser launch command

* fix: remove CUA open browser tool

* fix: align CUA desktop control guidance

* fix: harden CUA shell background handling

* fix: harden CUA runtime adapters

* fix: surface CUA filesystem failures

* fix: clarify CUA shell fallback support

* fix: harden CUA shell helpers

* fix: guard CUA file fallbacks

* fix: redact sensitive config log paths

* fix: guard CUA download fallback

* test: cover CUA GUI and shell env wiring

* fix: preserve CUA command result output

* fix: normalize CUA return codes

* fix: preserve foreground shell behavior

* fix: clean up failed CUA boots

* docs: add CUA sandbox runtime guide

* test: cover CUA GUI tool registration

* refactor: simplify CUA fallback handling

* refactor: simplify CUA shell helpers

* test: cover CUA screenshot result shapes
2026-04-28 01:40:14 +09:00
エイカク
67c7445d25 fix: prevent IME enter from sending chat (#7845)
* fix: prevent IME enter from sending chat

* fix: prevent IME enter from sending chat

* refactor: clarify IME composition state handling
2026-04-27 22:56:24 +09:00