Commit Graph

290 Commits

Author SHA1 Message Date
w33d
d0e5e68c55 fix: handle max_tokens for NVIDIA MiniMax M3 (#9209) 2026-07-12 16:20:48 +08:00
VectorPeak
a957b2e5dc fix: return HTTP errors for failed skill downloads (#9213)
* fix: return HTTP errors for failed skill downloads

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

* fix: harden skill archive error responses

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

* fix: use structured skill archive status codes

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

---------

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
2026-07-12 16:04:12 +08:00
VectorPeak
dcc40ede1d fix: validate dashboard account username updates (#9175)
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
2026-07-08 00:27:52 +08:00
Weilong Liao
0dee40bd9d feat: add event loop diagnostics (#9168)
* feat: add event loop diagnostics

* fix: write event loop watchdog dumps to rotating log

* chore: use fixed event loop diagnostic defaults

* fix: keep event loop watchdog alive after dump failures
2026-07-07 00:14:03 +08:00
killer-qert
afb0079116 fix: exit MCP anyio contexts in the lifecycle task on disable (#9132)
* fix: exit MCP anyio contexts in the lifecycle task on disable

#9070 moved MCP shutdown cleanup into the per-server lifecycle task so
that the anyio cancel scopes entered in connect_to_server() are exited
from the task that entered them. Running the cleanup through
asyncio.shield() defeats that: shield wraps the coroutine in a new
task, so disabling a server still fails with "Attempted to exit cancel
scope in a different task than it was entered in" and leaves the scope
state corrupted -- the failure mode behind the CPU spin reported in
#9068.

Await _terminate_mcp_client() directly instead. The graceful disable
path has no cancellation in flight, and on forced shutdown the
lifecycle task still runs its finally block in-task, so the shield only
served to break task affinity.

Closes #9068

* fix: absorb late cancellations during MCP shutdown cleanup

A cancellation delivered while the lifecycle task is already running its
finally-block cleanup would abort _terminate_mcp_client() halfway,
stranding the runtime entry and the MCP transport. Retry the cleanup in
the same task and uncancel() the absorbed request instead, so a forced
shutdown can no longer skip it.

* fix: guard Task.uncancel() for Python 3.10 runtimes

Task.uncancel() only exists on Python 3.11+. On 3.10 absorbing the
CancelledError is sufficient, so skip the call when unavailable.
2026-07-06 23:04:41 +08:00
Weilong Liao
4166d9ab58 fix: preserve qq official quoted message context (#9164)
* fix: preserve qq official quoted message context

* Update astrbot/core/platform/sources/qqofficial/qqofficial_platform_adapter.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* fix: standardize qq-botpy version specification in dependencies

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-07-06 22:55:21 +08:00
Glmg
ba7f8ebfb1 fix(webui): sync plugin activation status on enable (#9156)
* fix(webui): fix plugin activation status sync issue in turn_on_plugin #9149

* fix(webui): sync plugin activation status after enabling

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-06 21:16:14 +08:00
sama233
3b8caf37e6 test: cover POSIX file URI root preservation (#8906)
* test: cover POSIX file URI root preservation

* Update tests/test_media_utils.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Weilong Liao <37870767+Soulter@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-07-05 10:12:59 +08:00
tangtaizong666
c9eed7b65e fix: adapt MiMo STT to V2.5 models and reject non-WAV audio payloads (#9118)
* fix: adapt MiMo STT to V2.5 models and reject non-WAV audio

The MiMo-V2 series went offline on 2026-06-30, so the default STT model
mimo-v2-omni fails for every default configuration. Switch the default
to mimo-v2.5-asr, the dedicated speech recognition model whose official
docs use exactly the bare input_audio payload this provider sends.

For non-ASR multimodal models such as mimo-v2.5, the audio understanding
docs require a text instruction alongside the audio, so restore the
system/user transcription prompts for that model family only.

Also validate that the resolved audio payload really is RIFF/WAVE before
calling the API: when a platform voice file (e.g. Tencent SILK from QQ)
slips through the WAV conversion chain unchanged, fail locally with an
actionable error instead of the opaque HTTP 400 from the API.

Fixes #9113

* fix: accept unpadded MiMo wav headers

---------

Co-authored-by: tangtaizong666 <212687958+tangtaizong666@users.noreply.github.com>
2026-07-05 09:59:48 +08:00
VectorPeak
041fba4df4 fix: enforce ownership when reading ChatUI sessions (#9141) 2026-07-05 09:34:38 +08:00
Weilong Liao
b43cc6dee0 feat: improve ChatUI attachment display (#9134) 2026-07-04 17:56:33 +08:00
Soulter
20008f179c fix: preserve absolute custom workspace paths 2026-07-03 22:59:21 +08:00
NayukiChiba
8a31cf01f2 fix(core): improve web search API key failover
Merge PR #8896
2026-07-03 22:53:22 +08:00
lxfight
ea9e3421d9 fix: align knowledge base CRUD API contract with kb_name, canonical payload fields, and matching OpenAPI types (#9000)
Warning: Potential breaking changes in /kb related openapi.

* fix(kb): align CRUD API contract end-to-end

Unify knowledge base create/update/list with kb_name, canonical_payload,
optional list pagination with total, and matching OpenAPI plus dashboard types.

* fix: restore _model_dict references, add KnowledgeBaseCreateRequest, fix OpenAPI allOf validation

- Replace 3 remaining _model_dict() calls with payload.model_dump(exclude_none=True)
- Add KnowledgeBaseCreateRequest schema with required kb_name + embedding_provider_id
- Remove additionalProperties: false from OpenAPI allOf sub-schema to avoid validation failures
- Use Pydantic Field(alias="name") + populate_by_name=True for legacy name migration
- Delegate _canonical_kb_payload to KnowledgeBaseRequest to eliminate duplicated logic
- Add getattr default None for update_kb to prevent AttributeError
- Add validation error tests: missing kb_name, missing embedding_provider_id

* fix: address knowledge base contract follow-ups

* fix: preserve knowledge base create error shape
2026-07-03 22:18:56 +08:00
lxfight
e2f3b00088 fix(kb): clean up KBMedia records on document delete, fix update_kb_stats (#9120)
* fix(kb): clean up KBMedia records on document delete, fix update_kb_stats

- delete_document_by_id now deletes associated KBMedia records before
  removing the KBDocument row, preventing orphaned media data.
- update_kb_stats now passes kb_id filter to vec_db.count_documents,
  fixing chunk count that previously counted across all KBs.
- add tests for document deletion cleanup and update_kb_stats behavior.

* fix(kb): merge media and document deletion into single transaction
2026-07-03 22:13:23 +08:00
Weilong Liao
e7d5be632f feat: add ChatUI project workspaces (#9066)
* feat: add ChatUI project workspaces

* feat: refine chatui layout

* feat: enhance chat input and project view styles for attachment handling

* feat: adjust chat sidebar brand logo positioning

* feat: enhance project dialog with error handling and loading state
2026-07-03 21:54:20 +08:00
VectorPeak
89b80a6ca7 fix: enable only synced ModelScope MCP servers (#9084)
* fix: enable only synced ModelScope MCP servers

* fix: avoid mutating default MCP config
2026-07-03 01:05:25 +08:00
100yoGranny
413340fca5 fix: apply fallback chat models to background wakeups (#9094) 2026-07-03 00:40:20 +08:00
伊尔弥亚 - Irmia
152fb3be8f fix: skip _unbind_plugin for inactivated plugins in reload() (#9096)
* fix: skip _unbind_plugin for inactivated plugins in reload()

* fix: only skip _unbind_plugin for deactivated plugins on specified-plugin reload path

Revert the full reload unconditional smd.activated guard added in 555fcfa; it is unnecessary because load() re-adds everything after the clear anyway. Keep the guard only on the specified-plugin reload path.

* test: set tool active=False precondition in turn_on_plugin test; clean up mock_load in unbind test
2026-07-03 00:34:37 +08:00
Weilong Liao
1e3b12acc9 fix: preserve webhook callback responses
Preserve raw webhook callback responses and fix QQ webhook validation handling.
2026-07-03 00:25:09 +08:00
VectorPeak
70a52ea6d0 fix: reject non-200 download responses (#9085)
* fix: reject non-200 download responses

* fix: share download response handling
2026-07-02 11:53:45 +09:00
Cooper
3b41a870ff fix: updated reboot logic (#9073)
* Update updator.py

* test: cover Windows reboot process spawning

---------

Co-authored-by: 邹永赫 <1259085392@qq.com>
2026-07-02 11:33:47 +09:00
エイカク
b673cb375f fix: guard desktop-managed core restart (#9098) 2026-07-02 11:21:02 +09:00
Fiber
4cf210e503 fix: resample and downmix WAV files for Tencent Silk encoding (#9100)
* fix: resample and downmix WAV files for Tencent Silk encoding

* fix: improve WAV to Tencent Silk conversion by handling sample width and resampling
2026-07-01 22:33:36 +08:00
Haoran Xu
41f8960302 fix: astrbot_file_read_tool returns clear error for directory path instead of misleading Permission denied (#9088)
When LLM passes a directory path to astrbot_file_read_tool, the tool previously
returned Error: [Errno 13] Permission denied, misleading the LLM into thinking
it was a permissions issue. The real cause: _probe_local_file() calls open('rb')
on the path, which fails on directories with Errno 13 on Windows. This is caught
by except PermissionError and displayed as-is.

Fix: Add os.path.isdir() check in FileReadTool.call() before any file I/O, at
the earliest safe point after path normalization and permission validation.
Returns a clear message: '<path> is a directory, not a file. Use a file path
instead, or use astrbot_execute_shell to list directory contents.'

Changes:
- astrbot/core/tools/computer_tools/fs.py: add isdir guard
- tests/test_computer_fs_tools.py: add test_file_read_tool_rejects_directory_with_clear_message
2026-06-30 20:39:50 +08:00
LIghtJUNction
6067a70803 feat: support local plugin install (#8448)
* feat: support local plugin install

* fix: make editable plugin install symlink

* fix: harden local plugin install

* Update tests/test_cli_plugin.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update astrbot/cli/commands/cmd_plug.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-29 01:44:06 +08:00
lxfight
758e43273d fix: paginate knowledge base dashboard lists (#9055)
* fix: paginate knowledge base dashboard lists

* fix: preserve knowledge document search pagination
2026-06-28 14:00:45 +08:00
Weilong Liao
3d4c4ed01b fix: validate plugin install sources (#9061) 2026-06-28 13:45:59 +08:00
Gargantua
c1cc74b6bc fix: preserve fallback models for future tasks (#9054)
* fix: preserve fallback models for future tasks

* chore: remove local test markdown ignore

---------

Co-authored-by: Gargantua <22532097@zju.edu.cn>
2026-06-28 00:03:31 +08:00
Weilong Liao
de572e3fe0 fix: avoid duplicate send_message_to_user replies (#9051) 2026-06-27 16:57:17 +08:00
F. Abyssalis
d4fa9d3d5d fix: align OpenAI tool message sanitizer (#8350)
Co-authored-by: Soulter <905617992@qq.com>
2026-06-27 16:27:32 +08:00
Weilong Liao
8f30978c8d fix: separate plugin and tool activation state (#9048)
* fix: separate plugin and tool activation state

* style: apply ruff formatting

* fix: preserve manual tool deactivation on load

* fix: harden plugin tool state migration
2026-06-27 16:15:31 +08:00
Fiber
298078b536 Fix: KV storage not cleared on plugin uninstall. Improved cleanup logic and updated i18n strings to indicate database KV data removal. (#8291)
* fix: 完善插件卸载时的清理逻辑,新增KV数据清理,更新了多语言文案以说明会清理数据库KV数据

* fix: 修复插件关闭时不清理KV的问题,更新单元测试

* refactor: 统一插件ID生成逻辑

将插件ID生成逻辑抽离到StarMetadata类中,移除重复的代码实现,
同时在__post_init__中自动补全plugin_id字段。

* refactor: 将plugin_id属性从方法转换为属性,确保在属性赋值后正确计算
2026-06-27 16:06:14 +08:00
F. Abyssalis
8213c14cc6 fix: sanitize orphaned tool_result blocks in Anthropic provider (#8952)
* sanitize orphaned tool_result blocks in Anthropic provider

Sanitize tool_result blocks and merge consecutive messages with the same role to comply with Anthropic API requirements.

* Fix content handling in message merging logic

* fix: sanitize anthropic assistant messages

* fix: validate anthropic tool result ordering

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-06-27 15:18:33 +08:00
FuShang114
b8f4c7d515 fix: handle MiMo STT audio and reasoning output (#8938)
* fix: handle MiMo STT audio and reasoning output

* fix: 移除 MiMo STT 的系统和用户提示词配置

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-06-27 15:04:41 +08:00
Weilong Liao
0ef790d289 fix: track plugin install source for updates (#9037)
* fix: track plugin install source for updates

* feat: refine plugin source management flow

* test: align plugin update expectation
2026-06-27 15:02:04 +08:00
MUHAMED FAZAL PS
b5e29511ac fix: reliably kill shell process tree on Windows timeout (#8822)
* fix: reliably kill shell process tree on Windows timeout

Fixes #8809

* fix: remove redundant import and wrap taskkill in try/except

- Remove 'import subprocess as _sp' (subprocess already imported at top)
- Use subprocess.run directly with DEVNULL for stdout/stderr
- Wrap taskkill in try/except to avoid masking original TimeoutExpired
- If taskkill fails, cleanup failures don't prevent proc.wait() or re-raise

https://buymeacoffee.com/muhamedfazalps

* style: apply ruff formatting to local.py

* test: fix shell component tests to match Popen-based implementation

The tests were monkeypatching subprocess.run but the implementation
now uses subprocess.Popen + communicate() for timeout handling.
Updated tests to mock Popen instead.

Fixes CI Unit Tests failure

* fix: harden windows shell timeout cleanup

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-06-27 00:10:59 +08:00
Weilong Liao
c6b2c65b04 fix: preserve image formats in media handling (#9019)
* fix: preserve image formats in media handling

* fix: address image format review feedback

* fix: avoid tainted image temp path rename
2026-06-26 11:27:32 +08:00
Weilong Liao
473377f340 feat: update permission handling to delegate event context in guarded tools (#9001) 2026-06-25 16:18:04 +08:00
Weilong Liao
d90530af8e Revert "fix: reconnect MCP client on terminated session (#8694)" (#8991)
This reverts commit 2bda4e4d96.
2026-06-24 22:44:45 +08:00
EterUltimate
2bda4e4d96 fix: reconnect MCP client on terminated session (#8694)
* fix: reconnect MCP client on terminated session

* Update astrbot/core/agent/mcp_client.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update mcp_client.py

---------

Co-authored-by: Weilong Liao <37870767+Soulter@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-24 22:43:24 +08:00
FuShang114
b7cadfe704 fix: allow plugin page asset token fallback (#8970)
Co-authored-by: beidou-lab-macmini <beidou-lab-macmini@beidou-lab-macminideMac-mini.local>
2026-06-24 22:11:49 +08:00
Weilong Liao
421d718041 feat: show public version details on login (#8986)
* feat: show public version details on login

* fix: address login version review feedback
2026-06-24 21:46:29 +08:00
Weilong Liao
df4d93d724 fix: normalize cron weekday scheduling (#8984) 2026-06-24 16:22:58 +08:00
Tanishq
ae29a7eaf9 feat(websearch): add Exa as a web search provider (#8973)
- Add ExaWebSearchTool (web_search_exa) with keyword/semantic search,
  category filters, domain restrictions, and date range support
- Add ExaGetContentsTool (exa_get_contents) for extracting web page content
- Add _exa_search() and _exa_get_contents() API helpers hitting
  https://api.exa.ai/search and https://api.exa.ai/contents
- Add _EXA_KEY_ROTATOR for multi-key rotation
- Register Exa tools in _apply_web_search_tools() dispatch
- Add Exa to WEB_SEARCH_CITATION_TOOL_NAMES for citation support
- Add websearch_exa_key config default and provider option
- Add i18n metadata for en-US, zh-CN, ru-RU
- Add Exa section to docs (en + zh)
- Add 6 unit tests covering search, contents, error handling, and
  legacy config migration

Closes #5621
2026-06-24 15:53:47 +08:00
Weilong Liao
d36987dd19 fix: restore static runtime version
Fixes #8924
2026-06-20 22:06:24 +08:00
Weilong Liao
da7f53d5eb fix: keep system tools with persona tool lists (#8908) 2026-06-20 01:15:31 +08:00
Soulter
a7533aacda fix: fall back to stale WebUI when repair fails 2026-06-20 00:01:29 +08:00
lxfight
2d98d38078 fix: inject knowledge base context as temporary user content (#8904) 2026-06-19 22:48:23 +08:00
Weilong Liao
1b0f5cb0d3 fix: keep WebUI assets in sync with core version (#8901)
* fix: keep WebUI assets in sync with core version

* fix: import dashboard version before bundled fallback

* fix: remove stale WebUI dist robustly
2026-06-19 22:46:38 +08:00