Skip to content

fix: uploadFiles MCP 工具未区分「云存储上传」与「静态托管部署」,上传成功但页面 404#601

Closed
binggg wants to merge 1 commit into
mainfrom
automation/attribution-issue-mocvv0dg-69tn2d-uploadfiles-mcp-404
Closed

fix: uploadFiles MCP 工具未区分「云存储上传」与「静态托管部署」,上传成功但页面 404#601
binggg wants to merge 1 commit into
mainfrom
automation/attribution-issue-mocvv0dg-69tn2d-uploadfiles-mcp-404

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 28, 2026

Attribution issue

  • issueId: issue_mocvv0dg_69tn2d
  • category: tool
  • canonicalTitle: uploadFiles MCP 工具未区分「云存储上传」与「静态托管部署」,上传成功但页面 404
  • representativeRun: application-js-vite-hello-world-hosting-deploy/2026-04-24T12-30-27-1bd1f3

Automation summary

  • root_cause: The uploadFiles MCP tool description and related skill docs instructed AI agents to use "相对路径" (relative paths) for publicPath/base/assetPrefix when 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 full dist/ directory.
  • changes:
  1. mcp/src/tools/hosting.ts: Replaced uploadFiles description — removed misleading "使用相对路径" guidance; added explicit 4-point subdirectory deployment checklist (absolute base path required, rebuild required, cloudPath format, upload full dist/). Updated cloudPath parameter description to specify "no leading /" format.
  2. config/source/skills/web-development/SKILL.md: Replaced "Prefer relative asset paths" with detailed subdirectory 404 prevention guidance including absolute path requirement, rebuild verification, cloudPath format, full dist/ upload, and CDN cache note.
  3. **co

Changed files

  • config/source/guideline/cloudbase/SKILL.md
  • config/source/skills/cloudbase-platform/SKILL.md
  • config/source/skills/web-development/SKILL.md
  • config/source/skills/web-development/frameworks.md
  • doc/mcp-tools.md
  • doc/prompts/web-development.mdx
  • mcp/src/tools/hosting.ts

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +105 to +109
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`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@binggg
Copy link
Copy Markdown
Member Author

binggg commented May 12, 2026

Closing as duplicate: same case has newer PR #651. Keeping #651.

@binggg binggg closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant