Skip to content

chore: use only binary file for CreateFile api#30

Merged
mohamedveron merged 3 commits intomainfrom
CSB-1289-use-upload-binary-only
Apr 9, 2026
Merged

chore: use only binary file for CreateFile api#30
mohamedveron merged 3 commits intomainfrom
CSB-1289-use-upload-binary-only

Conversation

@mohamedveron
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 8, 2026 23:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the sandbox “Create file” API contract and SDK facades to send raw binary file content in the request body instead of a JSON { content: ... } payload.

Changes:

  • TypeScript Sandbox.files.create now accepts string | Blob | File and forwards a binary body to createFile.
  • Python FilesFacade.create_file now accepts bytes | str, converts to a binary payload, and calls create_file with a File upload type.
  • OpenAPI createFile requestBody changed to application/octet-stream with format: binary, plus additional OpenAPI formatting/structure changes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
together-sandbox-typescript/src/TogetherSandbox.ts Switches file creation to send binary bodies (Blob/File), with string-to-Blob conversion.
together-sandbox-python/together_sandbox/facade.py Switches file creation to send binary bodies by wrapping bytes in an upload File.
sandbox-openapi.json Updates createFile requestBody to raw binary octet-stream; includes additional spec changes (e.g., uid/gid fields, schema reshaping).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread together-sandbox-typescript/src/TogetherSandbox.ts Outdated
Comment thread together-sandbox-typescript/src/TogetherSandbox.ts
Comment thread together-sandbox-python/together_sandbox/facade.py
Comment thread sandbox-openapi.json
Comment on lines +2614 to 2622
"FileCreateRequest": {
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "File content to create"
}
}
},
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

FileCreateRequest is reintroduced under components/schemas but the createFile operation no longer references it (it now uses a raw application/octet-stream binary schema). Since this schema is unused, it will still be generated into SDKs and can confuse consumers about the supported request shape. Consider removing FileCreateRequest entirely, or (if it’s still intended) update createFile.requestBody to reference it and keep the request content-type as JSON.

Suggested change
"FileCreateRequest": {
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "File content to create"
}
}
},

Copilot uses AI. Check for mistakes.
Comment thread sandbox-openapi.json
Comment thread sandbox-openapi.json
@mohamedveron mohamedveron merged commit 49ae4d6 into main Apr 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants