feat: support pre-uploading files to a session before it starts#1282
feat: support pre-uploading files to a session before it starts#1282ambient-code[bot] wants to merge 3 commits intomainfrom
Conversation
Enable users to attach files during session creation that are uploaded directly to S3/MinIO storage. The session's init container (hydrate.sh) already downloads from this S3 path, so pre-uploaded files are automatically seeded into the workspace when the pod initializes. Backend changes: - Add `storage` package with MinIO/S3 client (upload, list, delete) - Add pre-upload endpoints: PUT/GET/DELETE file-uploads for sessions - S3 config loaded from env vars (S3_ENDPOINT, S3_BUCKET, AWS creds) - RBAC-checked, path-sanitized, works regardless of session pod state Frontend changes: - Add file attachment section to CreateSessionDialog - Upload route falls back to pre-upload endpoint on 409 (not running) - Files uploaded after session creation, before navigation Closes #1280 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implementation NotesArchitectureThis PR leverages the existing S3 state-sync architecture. The init container ( New Backend Endpoints
All endpoints perform RBAC checks and path sanitization. The session CR must exist but the pod does not need to be running. Frontend Flow
ConfigurationThe backend reads S3 config from environment variables: 🤖 Session |
- Downgrade minio-go from v7.0.100 (requires Go 1.25) to v7.0.82 which is compatible with the Go 1.24.6 used in the Dockerfile - Restore `toolchain go1.24.7` directive in go.mod - Fix gofmt formatting in storage/s3_test.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
| File | Component | Mode |
|---|---|---|
components/frontend/src/components/create-session-dialog.tsx |
runner | warn |
No action required — these components are in warn mode. Consider using the component's agent workflow for future changes.
📖 Specs: Runner Spec · Runner Constitution
Pull Reviews🚨 Concerning — Adds pre-upload file functionality allowing files to be staged in S3 before session startup, with frontend fallback handling, backend routing, S3 storage operations, and test coverage. Callouts
File-by-file breakdown
Generated by pull-reviews — automated video reviews for PRs |
Summary
/file-uploads/) that write files directly to MinIO/S3, bypassing the runnerhydrate.sh) already downloads from the same S3 path, so pre-uploaded files are automatically seeded into the workspaceCloses #1280
Test plan
cd components/backend && go build ./...cd components/backend && go test ./storage/ -vcd components/backend && go test -run TestFileUpload ./handlers/ -vcd components/frontend && npm run buildcd components/frontend && npx vitest run create-session-dialog-filescd components/frontend && npx vitest run upload-file-modal/workspace/file-uploads/after pod starts🤖 Ambient Session