Skip to content

Preserve skill upload file paths#1947

Open
kiwigitops wants to merge 1 commit into
openai:mainfrom
kiwigitops:fix-skills-upload-file-paths
Open

Preserve skill upload file paths#1947
kiwigitops wants to merge 1 commit into
openai:mainfrom
kiwigitops:fix-skills-upload-file-paths

Conversation

@kiwigitops

Copy link
Copy Markdown

Summary

  • preserve directory paths in multipart filenames for skill and skill-version uploads
  • keep the existing filename-stripping behavior for other multipart uploads
  • add form-helper and skills.create regressions

Fixes #1807

Testing

  • jest tests/form.test.ts --runInBand
  • jest tests/api-resources/skills/skills.test.ts --runInBand -t "preserves directory paths"
  • prettier --check src/internal/uploads.ts src/resources/skills/skills.ts src/resources/skills/versions/versions.ts tests/form.test.ts tests/api-resources/skills/skills.test.ts
  • git diff --check

@kiwigitops kiwigitops requested a review from a team as a code owner June 22, 2026 05:38

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

Copy link
Copy Markdown

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: 6896b2bbf8

ℹ️ 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 src/internal/uploads.ts
('path' in value && value.path && String(value.path)))) ||
'';

if (options.preserveFilePaths) return name || undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid preserving full URLs as upload filenames

When preserveFilePaths is enabled for skill uploads, getName still takes name from a Response.url, so files: [await fetch('https://cdn.example.com/my-skill/SKILL.md')] (allowed by Uploadable) now sends the multipart filename as the full URL instead of a relative path or basename. That gives the skill service an invalid tree entry and can leak the remote host in the uploaded path; URL-derived names should be normalized to a pathname/basename rather than returned verbatim.

Useful? React with 👍 / 👎.

@HAYDEN-OAI HAYDEN-OAI added the upstream Needs to be addressed in Stainless upstream label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Needs to be addressed in Stainless upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills.create: getName() strips directory paths from File names, breaking required directory structure

2 participants