fix: MCP uploadFiles 工具上传成功后静态托管仍返回 404,缺少部署完整性校验与后置步骤引导#650
Open
fix: MCP uploadFiles 工具上传成功后静态托管仍返回 404,缺少部署完整性校验与后置步骤引导#650
Conversation
… (issue_moj0dwx7_bkz1io)
|
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
|
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
全部 11 项测试通过。 摘要: - 根本原因: AI 代理在子目录部署时使用了错误的构建配置指南。多个技能文件和
uploadFiles工具描述指出,对于子目录部署,base/publicPath/assetPrefix应该使用相对路径('./'),这导致当浏览器访问的 URL 不带尾部斜杠(例如/vite-test)时,所有 JS/CSS 资产解析为根路径/而非/vite-test/,从而引发 404 错误。此外,缺少关于cloudPath格式(无前导斜杠)、上传完整dist/目录以及上传前强制重建的指导。 - 变更: 1.mcp/src/tools/hosting.ts(第一层 - 工具描述): 更新了uploadFiles工具描述,增加了子目录部署强制预检查清单(4项),将错误的“使用相对路径”指导更正为“必须使用绝对路径,例如/vite-test/”,添加了cloudPath格式规则(无前导/),更新了错误消息构建器以提供正确的建议,并更新了cloudPath参数描述。 2.mcp/src/tools/storage-hosting-guidance.test.ts: 更新了测试断言,以验证新的清单内容(“子目录部署强制前置检查”、“禁止使用 './'”,“不要带前导 '/'”)。 3.config/source/skills/web-development/SKILL.md(第一层 - 技能文本): 用详细的子目录部署指导替换了错误的“对于静态托管兼容性,优先使用相对资产路径”部分,其中包括绝对路径要求和4项预检查清单。 4.config/source/skills/web-development/frameworks.md(第一层 - 技能文本): 添加了 Vite 特定的子目录base配置指导,明确禁止base: './',并提供了正确的base: '/vite-test/'示例。 5.config/source/skills/cloudbase-platform/SKILL.md(第一层 - 技能文本): 在“存储与托管”下添加了新的“静态托管子目录部署”部分,包含相同的4项检查清单和cloudPath格式规则。 6.config/source/guideline/cloudbase/SKILL.md(第一层 - 技能文本): 在“静态托管 (Web)”部署部分添加了子目录预检查和cloudPath格式指导。 - 验证: 所有 3 个强制性回归测试通过,托管指导测试通过,`npx tsc --Changed files
config/source/guideline/cloudbase/SKILL.mdconfig/source/skills/cloudbase-platform/SKILL.mdconfig/source/skills/web-development/SKILL.mdconfig/source/skills/web-development/frameworks.mdmcp/src/tools/hosting.tsmcp/src/tools/storage-hosting-guidance.test.ts