Preserve nested filenames for skill uploads#1833
Preserve nested filenames for skill uploads#1833MukundaKatta wants to merge 2 commits intoopenai:masterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee5d1fec35
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| form.append( | ||
| key, | ||
| value, | ||
| stripFilenames ? getName(value) : (('name' in value && value.name && String(value.name)) || getName(value)), |
There was a problem hiding this comment.
Preserve stream paths when filename stripping is disabled
The new stripFilenames option is only applied in the isNamedBlob branch, but fs.ReadStream uploads (an allowed Uploadable) hit the isAsyncIterable branch above and still use getName(value), which drops directory components. That means skills.create() and skills.versions.create() still flatten paths like my-skill/SKILL.md to SKILL.md when callers pass streams, so directory uploads remain broken for a common Node usage pattern.
Useful? React with 👍 / 👎.
Summary
skills.create()andskills.versions.create()multipart uploadsmy-skill/SKILL.mdis preserved in the multipart bodyTesting
yarnis not installed in this environment