Repository navigation
fix(examples): binary flow uses raw-byte I/O - #109
Merged
Merged
Conversation
nicoche
approved these changes
Oct 28, 2026
The example used the legacy encoding="base64" convention (raw bytes in, SDK encodes). On the streamed /files routes that parameter flips meaning — content is base64 text decoded to disk — so raw bytes hit b64decode and fail with "Incorrect padding" against koyeb/sandbox:slim, which tracks executor main and turned the reconciler sandbox-suite flow red on merge. The slim tag always runs the streamed routes here, so drop base64 entirely: raw bytes in, raw bytes out (encoding=None), executor v0.0.24+.
sfroment
force-pushed
the
fix/examples-binary-files-base64
branch
from
October 28, 2026 16:44
e1b1306 to
5aed87a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
encoding="base64"means two different things across executor generations: the legacy JSON routes take raw bytes and encode them; the streamed/filesroutes (executor v0.0.24+) decode content that is base64 text. The example passed raw bytes, so against the streamed routes it hitbase64.b64decode(raw)→Incorrect padding.The example pins
koyeb/sandbox:slim, which sandbox-container CI rebuilds frommainon every merge — so it always runs the streamed routes (that's exactly what turned the reconciler sandbox-suite red on merge). So drop the base64 dance and showcase the binary-safe routes directly: raw bytes in, raw bytes out withencoding=None. Executor v0.0.24+ required, same asstat()and streamed writes.Evidence
...-fra-ccqck/sbq67/zrnnt, Oct 28:SandboxFilesystem/AsyncSandboxFilesystemagainst stateful fakes:pytest koyeb/sandbox→ 372 passedMerge Danger
Door: two-way
Blast Radius: examples only — no library code touched; revert is trivial. The reconciler sandbox-suite flow goes green on the next run after this lands. On pre-v0.0.24 executors the example now raises instead of round-tripping — unreachable in practice since the pinned
:slimtag tracks main, but note the write failure there surfaces as a rawUnicodeDecodeErrorrather than the SDK's "requires v0.0.24+" error; a cleaner legacy guard for bytes writes might be worth a follow-up in the SDK itself.