Skip to content

Commit a9bf8e1

Browse files
committed
Merge upstream/master into feat/openai-oauth-provider-source
2 parents 95c1752 + 589776a commit a9bf8e1

File tree

153 files changed

+8218
-1712
lines changed

Some content is hidden

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

153 files changed

+8218
-1712
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
### Modifications / 改动点
55

6-
<!--请总结你的改动:哪些核心文件被修改了?实现了什么功能?-->
76
<!--Please summarize your changes: What core files were modified? What functionality was implemented?-->
7+
<!--请总结你的改动:哪些核心文件被修改了?实现了什么功能?-->
88

99
- [x] This is NOT a breaking change. / 这不是一个破坏性变更。
1010
<!-- If your changes is a breaking change, please uncheck the checkbox above -->
@@ -21,7 +21,14 @@
2121
<!--If merged, your code will serve tens of thousands of users! Please double-check the following items before submitting.-->
2222
<!--如果分支被合并,您的代码将服务于数万名用户!在提交前,请核查一下几点内容。-->
2323

24-
- [ ] 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
25-
- [ ] 👀 我的更改经过了良好的测试,**并已在上方提供了“验证步骤”和“运行截图”**。/ My changes have been well-tested, **and "Verification Steps" and "Screenshots" have been provided above**.
26-
- [ ] 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 `requirements.txt``pyproject.toml` 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in `requirements.txt` and `pyproject.toml`.
27-
- [ ] 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.
24+
- [ ] 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
25+
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
26+
27+
- [ ] 👀 My changes have been well-tested, **and "Verification Steps" and "Screenshots" have been provided above**.
28+
/ 我的更改经过了良好的测试,**并已在上方提供了“验证步骤”和“运行截图”**
29+
30+
- [ ] 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in `requirements.txt` and `pyproject.toml`.
31+
/ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 `requirements.txt``pyproject.toml` 文件相应位置。
32+
33+
- [ ] 😮 My changes do not introduce malicious code.
34+
/ 我的更改没有引入恶意代码。

.github/workflows/coverage_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
pytest --cov=astrbot -v -o log_cli=true -o log_level=DEBUG
4141
4242
- name: Upload results to Codecov
43+
if: github.repository == 'AstrBotDevs/AstrBot'
4344
uses: codecov/codecov-action@v5
4445
with:
4546
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/dashboard_ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
build:
11+
if: github.repository == 'AstrBotDevs/AstrBot'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout repository
@@ -45,7 +46,7 @@ jobs:
4546
4647
- name: Create GitHub Release
4748
if: github.event_name == 'push'
48-
uses: ncipollo/release-action@v1.20.0
49+
uses: ncipollo/release-action@v1.21.0
4950
with:
5051
tag: release-${{ github.sha }}
5152
owner: AstrBotDevs

.github/workflows/docker-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
build-nightly-image:
14-
if: github.event_name == 'schedule'
14+
if: github.repository == 'AstrBotDevs/AstrBot' && github.event_name == 'schedule'
1515
runs-on: ubuntu-latest
1616
env:
1717
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
@@ -109,7 +109,7 @@ jobs:
109109
run: echo "Test Docker image has been built and pushed successfully"
110110

111111
build-release-image:
112-
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
112+
if: github.repository == 'AstrBotDevs/AstrBot' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')))
113113
runs-on: ubuntu-latest
114114
env:
115115
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PR Title Check
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
jobs:
8+
title-format:
9+
if: github.repository == 'AstrBotDevs/AstrBot'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
issues: write
14+
15+
steps:
16+
- name: Validate PR title
17+
uses: actions/github-script@v8
18+
with:
19+
script: |
20+
const title = (context.payload.pull_request.title || "").trim();
21+
// allow only:
22+
// feat: xxx
23+
// feat(scope): xxx
24+
const pattern = /^(feat)(\([a-z0-9-]+\))?:\s.+$/i;
25+
const isValid = pattern.test(title);
26+
const isSameRepo =
27+
context.payload.pull_request.head.repo.full_name === context.payload.repository.full_name;
28+
29+
if (!isValid) {
30+
if (isSameRepo) {
31+
try {
32+
await github.rest.issues.createComment({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
issue_number: context.payload.pull_request.number,
36+
body: [
37+
"⚠️ PR title format check failed.",
38+
"Required formats:",
39+
"- `feat: xxx`",
40+
"- `feat(scope): xxx`",
41+
"Please update your PR title and push again."
42+
].join("\n")
43+
});
44+
} catch (e) {
45+
core.warning(`Failed to post PR title comment: ${e.message}`);
46+
}
47+
} else {
48+
core.warning("Fork PR: comment permission is restricted; skip posting review comment.");
49+
}
50+
}
51+
52+
if (!isValid) {
53+
core.setFailed("Invalid PR title. Expected format: feat: xxx or feat(scope): xxx.");
54+
}

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ permissions:
2020
jobs:
2121
build-dashboard:
2222
name: Build Dashboard
23+
if: github.repository == 'AstrBotDevs/AstrBot'
2324
runs-on: ubuntu-24.04
2425
env:
2526
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
@@ -104,6 +105,7 @@ jobs:
104105
105106
publish-release:
106107
name: Publish GitHub Release
108+
if: github.repository == 'AstrBotDevs/AstrBot'
107109
runs-on: ubuntu-24.04
108110
needs:
109111
- build-dashboard
@@ -183,6 +185,7 @@ jobs:
183185
184186
publish-pypi:
185187
name: Publish PyPI
188+
if: github.repository == 'AstrBotDevs/AstrBot'
186189
runs-on: ubuntu-24.04
187190
needs:
188191
- publish-release

.github/workflows/stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818

1919
jobs:
2020
stale:
21+
if: github.repository == 'AstrBotDevs/AstrBot'
2122
runs-on: ubuntu-latest
2223
permissions:
2324
issues: write

.github/workflows/sync-wiki.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ concurrency:
1818

1919
jobs:
2020
sync:
21+
if: github.repository == 'AstrBotDevs/AstrBot'
2122
runs-on: ubuntu-latest
2223
permissions:
2324
contents: read

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")

0 commit comments

Comments
 (0)