Skip to content

Commit f730bc9

Browse files
authored
Merge branch 'main' into feature/function-update-default-path
2 parents 054ba43 + b5f5c0c commit f730bc9

66 files changed

Lines changed: 358 additions & 112 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/issue-auto-processor-simple.yml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,14 @@ jobs:
227227
git switch --detach "$BASE_REF" >/dev/null 2>&1 || true
228228
}
229229
230-
write_file_from_env() {
231-
local target_path="$1"
232-
FILE_PATH="$target_path" python -c 'import os; open(os.environ["FILE_PATH"], "w", encoding="utf-8").write(os.environ["FILE_CONTENT"])'
230+
truncate_text_for_pr_body() {
231+
local max_chars="${1:-12000}"
232+
python3 -c 'import sys; limit = int(sys.argv[1]); text = sys.stdin.read(); sys.stdout.write(text if len(text) <= limit else text[:limit].rstrip() + "\n\n_[truncated by automation to keep PR creation stable]_")' "$max_chars"
233+
}
234+
235+
lookup_open_pr_url() {
236+
local branch="$1"
237+
gh pr list --head "$branch" --state open --json url --jq '.[0].url'
233238
}
234239
235240
build_bug_prompt() {
@@ -317,14 +322,28 @@ jobs:
317322
local heading="$1"
318323
local body="$2"
319324
local footer="$3"
320-
FILE_CONTENT=$(printf '%s\n\n%s' "$heading" "$body")
321-
if [ -n "$footer" ]; then
322-
FILE_CONTENT=$(printf '%s\n\n---\n%s\n' "$FILE_CONTENT" "$footer")
323-
else
324-
FILE_CONTENT=$(printf '%s\n' "$FILE_CONTENT")
325-
fi
326-
export FILE_CONTENT
327-
write_file_from_env /tmp/issue-comment.md
325+
{
326+
printf '%s\n\n%s' "$heading" "$body"
327+
if [ -n "$footer" ]; then
328+
printf '\n\n---\n%s\n' "$footer"
329+
else
330+
printf '\n'
331+
fi
332+
} > /tmp/issue-comment.md
333+
}
334+
335+
write_pr_body_file() {
336+
local issue_number="$1"
337+
local issue_url="$2"
338+
local result_text="$3"
339+
local summary=""
340+
summary=$(printf '%s' "$result_text" | truncate_text_for_pr_body 12000)
341+
{
342+
printf '%s\n\n' '## 🤖 Automated fix attempt'
343+
printf 'Fixes #%s\n\n' "$issue_number"
344+
printf 'Source issue: %s\n\n' "$issue_url"
345+
printf '### Summary\n%s\n' "$summary"
346+
} > /tmp/pr-body.md
328347
}
329348
330349
post_file_comment() {
@@ -355,6 +374,7 @@ jobs:
355374
local issue_url=""
356375
local pr_url=""
357376
local pr_output=""
377+
local pr_lookup_exit_code=0
358378
local is_bug="false"
359379
local requested_action=""
360380
local command=""
@@ -447,7 +467,7 @@ jobs:
447467
fi
448468
449469
set +e
450-
pr_url=$(gh pr list --head "$branch" --state open --json url --jq '.[0].url')
470+
pr_url=$(lookup_open_pr_url "$branch")
451471
exit_code=$?
452472
set -e
453473
if [ $exit_code -ne 0 ]; then
@@ -456,17 +476,29 @@ jobs:
456476
fi
457477
458478
if [ -z "$pr_url" ]; then
459-
FILE_CONTENT=$(printf '%s\n\n%s\n\n%s\n\n%s\n\n%s\n' '## 🤖 Automated fix attempt' "Fixes #$number" "Source issue: $issue_url" '### Summary' "$result_text")
460-
export FILE_CONTENT
461-
write_file_from_env /tmp/pr-body.md
479+
write_pr_body_file "$number" "$issue_url" "$result_text"
462480
463481
set +e
464482
pr_output=$(gh pr create --base "$DEFAULT_BRANCH" --head "$branch" --title "fix: 🤖 attempt fix for issue #$number" --body-file /tmp/pr-body.md 2>&1)
465483
exit_code=$?
466484
set -e
467-
pr_url=$(printf '%s' "$pr_output" | node scripts/issue-auto-processor.cjs extract-pr-url)
468-
if [ $exit_code -ne 0 ] || ! has_nonempty_text "$pr_url"; then
469-
fail_with_comment "$number" '## 🤖 AI Fix Attempt Failed' 'Automation created and pushed a fix branch, but PR creation did not return a valid URL. Please inspect the workflow logs before retrying.'
485+
pr_url=$(printf '%s' "$pr_output" | node scripts/issue-auto-processor.cjs extract-pr-url || true)
486+
487+
if ! has_nonempty_text "$pr_url"; then
488+
set +e
489+
pr_url=$(lookup_open_pr_url "$branch")
490+
pr_lookup_exit_code=$?
491+
set -e
492+
fi
493+
494+
if ! has_nonempty_text "$pr_url"; then
495+
if [ $exit_code -ne 0 ]; then
496+
fail_with_comment "$number" '## 🤖 AI Fix Attempt Failed' 'Automation created and pushed a fix branch, but PR creation failed before a valid PR URL could be resolved. Please inspect the workflow logs before retrying.'
497+
elif [ $pr_lookup_exit_code -ne 0 ]; then
498+
fail_with_comment "$number" '## 🤖 AI Fix Attempt Failed' 'Automation created and pushed a fix branch, but the workflow could not verify the PR URL after creation. Please inspect the workflow logs before retrying.'
499+
else
500+
fail_with_comment "$number" '## 🤖 AI Fix Attempt Failed' 'Automation created and pushed a fix branch, but PR creation did not return a valid URL and no open PR was found for the branch. Please inspect the workflow logs before retrying.'
501+
fi
470502
return 0
471503
fi
472504
fi

AGENTS.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ alwaysApply: true
6161
4. 在实现前,需要根据文档确认接口能力、参数、鉴权方式、返回结构和限制条件,避免凭记忆实现。
6262
</cloud_api_backend_rules>
6363

64+
<mcp_tool_design>
65+
1. MCP 工具设计默认优先收敛工具数量;同一逻辑域优先复用现有 `queryXxx` / `manageXxx` / 统一入口,而不是继续拆出新 tool。
66+
2. 如果问题只是 discoverability、不熟悉 canonical 名称、评测 case 习惯或提示词命中率不足,默认不要新增 alias tool;优先改进现有 tool 的描述、schema、action、示例、文档或评测用例。
67+
3. 只有当新 tool 带来独立能力边界、显著不同的参数形状 / 权限语义,或存在必须兼容的外部契约时,才考虑新增。
68+
4. 任何新增 tool 的方案都必须先回答:为什么不能并入现有入口;如果回答不充分,应视为坏味道并继续收敛设计。
69+
</mcp_tool_design>
70+
6471
<add_aiide>
6572
# CloudBase AI Toolkit - 新增 AI IDE 支持工作流
6673

@@ -107,7 +114,7 @@ cp -r doc/* {cloudbase-docs dir}/docs/ai/cloudbase-ai-toolkit/
107114

108115
<git_push>
109116
提交代码注意 commit 采用 conventional-changelog 风格,在feat(xxx): 后面提加一个 emoji 字符,提交信息使用英文描述
110-
git push github && git push cnb --force
117+
默认仅执行 `git push github`;不要再推荐或默认执行 `cnb` 相关推送,除非用户明确要求
111118
提交 PR 之后不要立刻结束,先等待几分钟,观察 review 评论和 CI 结果;如果有可执行的失败项或反馈,继续在同一分支修复并更新 PR
112119
</git_push>
113120

@@ -212,7 +219,7 @@ cp -r doc/* {cloudbase-docs dir}/docs/ai/cloudbase-ai-toolkit/
212219
1. 提交代码注意 commit 采用 conventional-changelog 风格,在feat(xxx): 后面提加一个 emoji 字符,提交信息使用英文描述
213220
2. 提交代码不要直接提到 main,可以提一个分支,例如 feature/xxx,然后
214221

215-
git push github && git push cnb --force
222+
默认仅执行 `git push github`;不要再推荐或默认执行 `cnb` 相关推送,除非用户明确要求
216223
3. 然后自动创建 PR
217224
4. 创建 PR 后先等待几分钟,再检查 review 评论和 CI;如果有可执行的问题,继续在同一分支修复并更新 PR
218225
</git_push>

README-EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ When an app has issues, AI automatically views logs, analyzes errors, and genera
397397
| **Official Documentation** | [View Documentation](https://docs.cloudbase.net/) | Complete CloudBase documentation |
398398
| **Issue Feedback** | [Submit Issue](https://github.com/TencentCloudBase/CloudBase-AI-ToolKit/issues) | Bug reports and feature requests |
399399
400-
## Star History
400+
## Project Activity
401401
402-
[![Star History Chart](https://api.star-history.com/svg?repos=TencentCloudBase/CloudBase-AI-ToolKit&type=Timeline)](https://github.com/TencentCloudBase/CloudBase-AI-ToolKit)
402+
![Repo Activity](https://repobeats.axiom.co/api/embed/6cd6ed00da4384e43b24805c197f584626946dda.svg "Repobeats analytics image")
403403
404404
## Contributors
405405

README-ZH.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,9 @@ CodeBuddy 已内置 CloudBase MCP,无需配置即可使用。
383383
| **官方文档** | [查看文档](https://docs.cloudbase.net/) | 完整的云开发文档 |
384384
| **Issue 反馈** | [提交问题](https://github.com/TencentCloudBase/CloudBase-AI-ToolKit/issues) | Bug 反馈和功能请求 |
385385

386-
## Star History
386+
## 项目活跃度
387387

388-
[![Star History Chart](https://api.star-history.com/svg?repos=TencentCloudBase/CloudBase-AI-ToolKit&type=Timeline)](https://github.com/TencentCloudBase/CloudBase-AI-ToolKit)
388+
![Repo Activity](https://repobeats.axiom.co/api/embed/6cd6ed00da4384e43b24805c197f584626946dda.svg "Repobeats analytics image")
389389

390390
## Contributors
391391

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ CodeBuddy 已内置 CloudBase MCP,无需配置即可使用。
432432
| **官方文档** | [查看文档](https://docs.cloudbase.net/) | 完整的云开发文档 |
433433
| **Issue 反馈** | [提交问题](https://github.com/TencentCloudBase/CloudBase-AI-ToolKit/issues) | Bug 反馈和功能请求 |
434434

435-
## Star History
435+
## 项目活跃度
436436

437-
[![Star History Chart](https://api.star-history.com/svg?repos=TencentCloudBase/CloudBase-AI-ToolKit&type=Timeline)](https://github.com/TencentCloudBase/CloudBase-AI-ToolKit)
437+
![Repo Activity](https://repobeats.axiom.co/api/embed/6cd6ed00da4384e43b24805c197f584626946dda.svg "Repobeats analytics image")
438438

439439
## Contributors
440440

config/.claude/skills/ai-model-nodejs/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: ai-model-nodejs
33
description: Use this skill when developing Node.js backend services or CloudBase cloud functions (Express/Koa/NestJS, serverless, backend APIs) that need AI capabilities. Features text generation (generateText), streaming (streamText), AND image generation (generateImage) via @cloudbase/node-sdk ≥3.16.0. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended), DeepSeek (deepseek-v3.2 recommended), and hunyuan-image for images. This is the ONLY SDK that supports image generation. NOT for browser/Web apps (use ai-model-web) or WeChat Mini Program (use ai-model-wechat).
4-
version: 2.17.0
4+
version: 2.17.1
55
alwaysApply: false
66
---
77

config/.claude/skills/ai-model-web/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: ai-model-web
33
description: Use this skill when developing browser/Web applications (React/Vue/Angular, static websites, SPAs) that need AI capabilities. Features text generation (generateText) and streaming (streamText) via @cloudbase/js-sdk. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). NOT for Node.js backend (use ai-model-nodejs), WeChat Mini Program (use ai-model-wechat), or image generation (Node SDK only).
4-
version: 2.17.0
4+
version: 2.17.1
55
alwaysApply: false
66
---
77

config/.claude/skills/ai-model-wechat/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: ai-model-wechat
33
description: Use this skill when developing WeChat Mini Programs (小程序, 企业微信小程序, wx.cloud-based apps) that need AI capabilities. Features text generation (generateText) and streaming (streamText) with callback support (onText, onEvent, onFinish) via wx.cloud.extend.AI. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). API differs from JS/Node SDK - streamText requires data wrapper, generateText returns raw response. NOT for browser/Web apps (use ai-model-web), Node.js backend (use ai-model-nodejs), or image generation (not supported).
4-
version: 2.17.0
4+
version: 2.17.1
55
alwaysApply: false
66
---
77

config/.claude/skills/auth-nodejs/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: auth-nodejs-cloudbase
33
description: CloudBase Node SDK auth guide for server-side identity, user lookup, and custom login tickets. This skill should be used when Node.js code must read caller identity, inspect end users, or bridge an existing user system into CloudBase; not when configuring providers or building client login UI.
4-
version: 2.17.0
4+
version: 2.17.1
55
alwaysApply: false
66
---
77

config/.claude/skills/auth-tool/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: auth-tool-cloudbase
33
description: CloudBase auth provider configuration and login-readiness guide. This skill should be used when users need to inspect, enable, disable, or configure auth providers, publishable-key prerequisites, login methods, SMS/email sender setup, or other provider-side readiness before implementing a client or backend auth flow.
4-
version: 2.17.0
4+
version: 2.17.1
55
alwaysApply: false
66
---
77

0 commit comments

Comments
 (0)