Skip to content

Commit a1255e2

Browse files
amikofalvyclaude
andcommitted
fix: address PR review comments
- Clarify Vercel Blob is also a valid production backend (serves via proxy) - Add per-service S3-compatible path-style guidance (R2 vs B2 vs Spaces) - Make first resolve-blob-uris test explicitly set its mock (test isolation) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6b871fc commit a1255e2

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

agents-api/src/domains/run/services/__tests__/resolve-blob-uris.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ describe('resolveMessageBlobUris', () => {
2929
});
3030

3131
it('resolves blob file parts to media proxy URLs when presigned URLs are not available', async () => {
32+
const { getBlobStorageProvider } = await import('../blob-storage/index');
33+
vi.mocked(getBlobStorageProvider).mockReturnValue({
34+
upload: vi.fn(),
35+
download: vi.fn(),
36+
delete: vi.fn(),
37+
});
38+
3239
const content: MessageContent = {
3340
text: 'Hello',
3441
parts: [

agents-docs/content/deployment/add-other-services/s3-blob-storage.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When S3 is configured, media URLs in conversation responses are **presigned S3 U
1515
- **Domain isolation** — media is served from `*.s3.amazonaws.com`, separate from your API domain
1616
- **Time-limited access** — presigned URLs expire after 2 hours (configurable via `BLOB_STORAGE_PRESIGNED_URL_EXPIRY_SECONDS`)
1717

18-
When S3 is not configured, the framework falls back to the local filesystem with a server-side media proxy.
18+
When S3 is not configured, the framework falls back to Vercel Blob (if `BLOB_READ_WRITE_TOKEN` is set) or the local filesystem. Both Vercel Blob and local storage serve files through a server-side media proxy rather than presigned URLs.
1919

2020
## Step 1: Create an S3 Bucket
2121

@@ -61,12 +61,13 @@ All four variables are required when S3 is enabled.
6161

6262
### S3-Compatible Services
6363

64-
For S3-compatible services (Cloudflare R2, DigitalOcean Spaces, Backblaze B2), add:
64+
For S3-compatible services, set `BLOB_STORAGE_S3_ENDPOINT` and enable path-style access where required:
6565

66-
```bash
67-
BLOB_STORAGE_S3_ENDPOINT=https://your-custom-endpoint
68-
BLOB_STORAGE_S3_FORCE_PATH_STYLE=true
69-
```
66+
| Service | `BLOB_STORAGE_S3_ENDPOINT` | `BLOB_STORAGE_S3_FORCE_PATH_STYLE` |
67+
|---|---|---|
68+
| **Cloudflare R2** | `https://<account-id>.r2.cloudflarestorage.com` | Not needed (virtual-hosted style) |
69+
| **DigitalOcean Spaces** | `https://<region>.digitaloceanspaces.com` | Not needed |
70+
| **Backblaze B2** | `https://s3.<region>.backblazeb2.com` | `true` |
7071

7172
### Optional: Presigned URL Expiry
7273

@@ -86,7 +87,7 @@ The framework selects a storage backend based on which environment variables are
8687
|---|---|---|
8788
| 1 | **S3** | `BLOB_STORAGE_S3_BUCKET` is set |
8889
| 2 | **Vercel Blob** | `BLOB_READ_WRITE_TOKEN` is set |
89-
| 3 | **Local filesystem** | Neither is set (default) |
90+
| 3 | **Local filesystem** | Neither is set (default, local dev only) |
9091

9192
<Callout type="warning">
9293
Changing the storage backend after files have been uploaded will make previously stored files inaccessible. Plan your storage backend before going to production.

0 commit comments

Comments
 (0)