Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sandbox-sidecar/src/runners/e2bRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,15 @@ export class E2BSandboxRunner implements SandboxRunner {
// Write the config archive
const archivePath = `${workDir}/bundle.tar.gz`;
const archiveBuffer = Buffer.from(job.payload.configArchive, "base64");
await sandbox.files.write(archivePath, archiveBuffer.buffer);

// IMPORTANT: Extract exact-sized ArrayBuffer to avoid writing extra padding bytes
// archiveBuffer.buffer can include unused bytes if the Buffer is a slice/view of a larger ArrayBuffer
// This was causing intermittent "gzip: invalid header" errors
const exactBuffer = archiveBuffer.buffer.slice(
archiveBuffer.byteOffset,
archiveBuffer.byteOffset + archiveBuffer.byteLength
);
await sandbox.files.write(archivePath, exactBuffer);

// Extract the archive (excluding any existing state files to avoid conflicts)
// Use gunzip + tar separately for better compatibility across tar versions
Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/UnitCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ export default function UnitCreateForm({
const [isCreating, setIsCreating] = React.useState(false)
const [error, setError] = React.useState<string | null>(null)

// Remote runs beta is now always enabled
const remoteRunsEnabled = true
// Remote runs are gated by localStorage flag for beta testing
// Set localStorage.setItem('REMOTE_RUNS', 'true') to enable
const remoteRunsEnabled = typeof window !== 'undefined' && localStorage.getItem('REMOTE_RUNS') === 'true'

const handleCreate = async () => {
if (!unitName.trim()) return
Expand Down
Loading