Skip to content

Commit eb743a4

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix/6661-streaming-tool-call-index
2 parents 8525d97 + 11c7591 commit eb743a4

124 files changed

Lines changed: 7726 additions & 1622 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
echo "tag=$tag" >> "$GITHUB_OUTPUT"
5252
5353
- name: Setup pnpm
54-
uses: pnpm/action-setup@v4.4.0
54+
uses: pnpm/action-setup@v5.0.0
5555
with:
5656
version: 10.28.2
5757

.github/workflows/unit_tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'README*.md'
9+
- 'changelogs/**'
10+
- 'dashboard/**'
11+
pull_request:
12+
workflow_dispatch:
13+
14+
jobs:
15+
unit-tests:
16+
name: Run pytest suite
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v6
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install uv
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install uv
33+
34+
- name: Run tests
35+
run: |
36+
chmod +x scripts/run_pytests_ci.sh
37+
bash ./scripts/run_pytests_ci.sh ./tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ GenieData/
6363
.kilocode/
6464
.worktrees/
6565

66+
dashboard/bun.lock

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<a href="https://astrbot.app/">Documentation</a> |
3333
<a href="https://blog.astrbot.app/">Blog</a> |
3434
<a href="https://astrbot.featurebase.app/roadmap">Roadmap</a> |
35-
<a href="https://github.com/AstrBotDevs/AstrBot/issues">Issue Tracker</a>
35+
<a href="https://github.com/AstrBotDevs/AstrBot/issues">Issue Tracker</a>
3636
<a href="mailto:community@astrbot.app">Email Support</a>
3737
</div>
3838

astrbot/builtin_stars/web_searcher/main.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ async def edit_web_search_tools(
567567
if provider == "default":
568568
web_search_t = func_tool_mgr.get_func("web_search")
569569
fetch_url_t = func_tool_mgr.get_func("fetch_url")
570-
if web_search_t:
570+
if web_search_t and web_search_t.active:
571571
tool_set.add_tool(web_search_t)
572-
if fetch_url_t:
572+
if fetch_url_t and fetch_url_t.active:
573573
tool_set.add_tool(fetch_url_t)
574574
tool_set.remove_tool("web_search_tavily")
575575
tool_set.remove_tool("tavily_extract_web_page")
@@ -578,9 +578,9 @@ async def edit_web_search_tools(
578578
elif provider == "tavily":
579579
web_search_tavily = func_tool_mgr.get_func("web_search_tavily")
580580
tavily_extract_web_page = func_tool_mgr.get_func("tavily_extract_web_page")
581-
if web_search_tavily:
581+
if web_search_tavily and web_search_tavily.active:
582582
tool_set.add_tool(web_search_tavily)
583-
if tavily_extract_web_page:
583+
if tavily_extract_web_page and tavily_extract_web_page.active:
584584
tool_set.add_tool(tavily_extract_web_page)
585585
tool_set.remove_tool("web_search")
586586
tool_set.remove_tool("fetch_url")
@@ -590,9 +590,8 @@ async def edit_web_search_tools(
590590
try:
591591
await self.ensure_baidu_ai_search_mcp(event.unified_msg_origin)
592592
aisearch_tool = func_tool_mgr.get_func("AIsearch")
593-
if not aisearch_tool:
594-
raise ValueError("Cannot get Baidu AI Search MCP tool.")
595-
tool_set.add_tool(aisearch_tool)
593+
if aisearch_tool and aisearch_tool.active:
594+
tool_set.add_tool(aisearch_tool)
596595
tool_set.remove_tool("web_search")
597596
tool_set.remove_tool("fetch_url")
598597
tool_set.remove_tool("web_search_tavily")
@@ -602,7 +601,7 @@ async def edit_web_search_tools(
602601
logger.error(f"Cannot Initialize Baidu AI Search MCP Server: {e}")
603602
elif provider == "bocha":
604603
web_search_bocha = func_tool_mgr.get_func("web_search_bocha")
605-
if web_search_bocha:
604+
if web_search_bocha and web_search_bocha.active:
606605
tool_set.add_tool(web_search_bocha)
607606
tool_set.remove_tool("web_search")
608607
tool_set.remove_tool("fetch_url")

astrbot/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.20.1"
1+
__version__ = "4.22.0"

astrbot/core/agent/mcp_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import asyncio
22
import logging
3+
import os
4+
import sys
35
from contextlib import AsyncExitStack
46
from datetime import timedelta
57
from typing import Generic
@@ -45,6 +47,22 @@ def _prepare_config(config: dict) -> dict:
4547
return config
4648

4749

50+
def _prepare_stdio_env(config: dict) -> dict:
51+
"""Preserve Windows executable resolution for stdio subprocesses."""
52+
if sys.platform != "win32":
53+
return config
54+
55+
pathext = os.environ.get("PATHEXT")
56+
if not pathext:
57+
return config
58+
59+
prepared = config.copy()
60+
env = dict(prepared.get("env") or {})
61+
env.setdefault("PATHEXT", pathext)
62+
prepared["env"] = env
63+
return prepared
64+
65+
4866
async def _quick_test_mcp_connection(config: dict) -> tuple[bool, str]:
4967
"""Quick test MCP server connectivity"""
5068
import aiohttp
@@ -214,6 +232,7 @@ def logging_callback(
214232
)
215233

216234
else:
235+
cfg = _prepare_stdio_env(cfg)
217236
server_params = mcp.StdioServerParameters(
218237
**cfg,
219238
)

astrbot/core/agent/run_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ContextWrapper(Generic[TContext]):
1616
context: TContext
1717
messages: list[Message] = Field(default_factory=list)
1818
"""This field stores the llm message context for the agent run, agent runners will maintain this field automatically."""
19-
tool_call_timeout: int = 60 # Default tool call timeout in seconds
19+
tool_call_timeout: int = 120 # Default tool call timeout in seconds
2020

2121

2222
NoContext = ContextWrapper[None]

0 commit comments

Comments
 (0)