fix: uploadFiles MCP 工具未区分「云存储上传」与「静态托管部署」,上传成功但页面 404#601
Conversation
…issue_mocvv0dg_69tn2d)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32d8a4267a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 2. **Subdirectory deployment checklist** (the #1 cause of post-deploy 404s): | ||
| - Build config `base` / `publicPath` / `assetPrefix` MUST be set to the absolute subdirectory path with leading and trailing slashes (e.g. `'/vite-test/'`). NEVER use `'./'` or empty string — relative paths break in subdirectory deployments. | ||
| - After changing build config, MUST rebuild and verify that asset paths in the build output (e.g. `dist/index.html`) match the configured prefix (not `/` or relative paths). | ||
| - `uploadFiles` `cloudPath` is relative to hosting root without leading `/` (e.g. `'vite-test'` not `'/vite-test'`). | ||
| - Upload the entire build output directory (`dist/`), not just `index.html`. |
There was a problem hiding this comment.
Regenerate cloudbase-platform prompt after skill update
The new subdirectory-deployment checklist added here is not propagated to doc/prompts/cloudbase-platform.mdx (its “Storage and Hosting” section still jumps directly to “Static Hosting Domain” at line 143), so public prompt docs now diverge from the skill source and users of the prompt page miss the new 404-prevention guidance. This also violates the repository rule in AGENTS.md (<skills_and_rules_maintenance>) that changes to config/source/skills/cloudbase-platform/SKILL.md affecting public prompts must be synced via prompt generation before commit.
Useful? React with 👍 / 👎.
Attribution issue
Automation summary
uploadFilesMCP tool description and related skill docs instructed AI agents to use "相对路径" (relative paths) forpublicPath/base/assetPrefixwhen deploying to subdirectories. Relative paths like./break subdirectory deployments because the access URL may lack a trailing slash, causing all JS/CSS assets to 404. The correct guidance is to use absolute paths matching the deployment target (e.g.,/vite-test/). Additionally, there was no pre-deployment checklist forcing agents to verify build config, rebuild after config changes, or upload the fulldist/directory.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.mddoc/mcp-tools.mddoc/prompts/web-development.mdxmcp/src/tools/hosting.ts