fix: MCP工具cloudPath参数格式约定不明确导致路径不一致#574
Closed
binggg wants to merge 16 commits into
Closed
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Member
Author
Attribution post-PR evaluation
Cases
|
Member
Author
方向修正说明(Review Feedback)经分析,当前 PR 的修复方向需要调整: 问题诊断反复 evaluation 失败的根本原因是:AI 在部署到子目录时经常跳过设置 publicPath/base/assetPrefix,而不是不知道 cloudPath 格式。 当前 PR 聚焦在 cloudPath 格式约定(去掉前导 /),这只是被动提示,无法阻止 AI 忽略关键配置步骤。 正确方向应在 web-development Skill 中增加**"子目录部署强制二次确认"机制**: 当 cloudPath 非空(部署到子目录)时,在调用 uploadFiles 前必须完成以下强制确认:
任何一项未通过时,禁止调用 uploadFiles。 建议修改
此评论用于记录 review 结论,引导后续修复方向。 |
- Add detectAbsoluteRootPaths() to scan index.html for absolute root path references (e.g., src=/assets/...) when deploying to a sub-directory (cloudPath non-empty). - Strengthen uploadFiles description and cloudPath schema describe with a mandatory sub-directory deployment checklist. - Return a prominent publicPathWarning in the tool result when absolute root paths are detected, so the AI sees the warning immediately. - Update web-development SKILL.md to align: replace passive step description with a mandatory checklist (Set → Rebuild → Verify).
Member
Author
修正说明更新 — 代码已修改根据 review 反馈,已重新修改 PR 方向,从"cloudPath 格式约定"改为"子目录部署强制确认机制"。 实际改动1. MCP 工具层(
2. Skill 层(
机制对比
这样即使 AI 忽略 skill,调用工具时也会读到强制确认清单;即使 AI 跳过确认直接上传,工具运行时也会检测并返回 WARNING。 |
When cloudPath is non-empty (sub-directory deployment), the tool now requires publicPathConfigured=true or it throws an error immediately. This makes the guard impossible to skip — the AI must explicitly declare that base/publicPath/assetPrefix has been set and rebuilt. Also updates web-development SKILL.md to document the new parameter and example call.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attribution issue
Automation summary
layerVersion action cloudPath cloudPath README.md tencent-cloud
Changed files
mcp/src/tools/hosting.tsmcp/src/tools/storage-hosting-guidance.test.ts