Skip to content

fix: uploadFiles MCP 工具 cloudPath 参数行为不明确且缺少部署状态反馈,导致静态托管部署验证失败#684

Open
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mojhcq5h-2u7mxc-uploadfiles-mcp-cloudpath
Open

fix: uploadFiles MCP 工具 cloudPath 参数行为不明确且缺少部署状态反馈,导致静态托管部署验证失败#684
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mojhcq5h-2u7mxc-uploadfiles-mcp-cloudpath

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 29, 2026

Attribution issue

  • issueId: issue_mojhcq5h_2u7mxc
  • category: tool
  • canonicalTitle: uploadFiles MCP 工具 cloudPath 参数行为不明确且缺少部署状态反馈,导致静态托管部署验证失败
  • representativeRun: atomic-js-cloudbase-hosting-deploy/2026-04-29T03-11-24-7b151a

Automation summary

  • root_cause: The uploadFiles MCP tool's cloudPath parameter was passed directly to the SDK without normalization. When users passed cloudPath: "/" for root deployment, the SDK created file keys like /index.html, resulting in double-slash paths like //index.html in the Location field. This caused the grader to fail when trying to verify the deployed files. Additionally, the parameter description was unclear about whether to include leading slashes, and the deployment status feedback was minimal ("文件上传成功").
  • changes:
  1. Updated cloudPath parameter description (mcp/src/tools/hosting.ts:264) to clarify that paths should not start with slashes (e.g., /files) and that empty string or omitting the parameter is preferred for root deployment.
  2. Added normalization logic (mcp/src/tools/hosting.ts:286-287) to strip leading/trailing slashes from cloudPath before passing to the SDK, preventing double-slash issues.
  3. Added normalization for multi-file uploads' cloudPath (mcp/src/tools/hosting.ts:293-296).
  4. Enhanced deployment status feedback (mcp/src/tools/hosting.ts:348-372) with clear information: number of files uploaded, target deployment path, static domain, and a note

Changed files

  • 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: d7fdb6c7fa

ℹ️ 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 thread mcp/src/tools/hosting.ts
}

// Build deployment status summary
const uploadedFiles = (uploadResult.files as Array<{ options?: { Key?: string } }>) || [];
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 Handle empty SDK upload result before reading files

Guard this uploadResult.files access because hosting.uploadFiles() can legally return undefined when there are no files to upload (e.g., empty directory or all files filtered by ignore), and the current code will then throw TypeError: Cannot read properties of undefined after the upload call. This turns a valid no-op upload into a tool failure, so the response path should tolerate an undefined result before building the deployment summary.

Useful? React with 👍 / 👎.

@binggg
Copy link
Copy Markdown
Member Author

binggg commented Apr 29, 2026

Attribution post-PR evaluation

  • visibility: internal identifiers, run ids, and private links are intentionally omitted
  • attempt: 1
  • eval_scope: primary_only
  • overall: FAILED
  • summary: at least one planned evaluation case failed
  • updated_at: 2026-04-29T04:13:19.304Z

Cases

  • [FAILED] — primary — evaluation failed

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