buzz-acp: image chunks with only chunk.uri fail when the CDN needs auth (Blossom-hosted media)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Summary
When an agent (via `buzz-acp` → `claude-agent-acp`) receives an image chunk containing only `chunk.uri` (no inline `chunk.data`), and that URL requires custom auth to fetch (e.g. Buzz's Blossom-authenticated CDN at `*.communities.buzz.xyz/media/…`), the request to Anthropic fails with:
```
API Error: 400 Could not process image
```
Anthropic fetches the URL server-side without the Blossom auth header, gets a 401 from the CDN, and reports it back as a 400 "could not process image" error to the agent.
## Impact
Blocks every agent that needs to read a screenshot posted in Buzz. On our team-workspace we hit ~10 identical crashes today from a single screenshot posted to a channel. Not agent-specific; affects any managed agent running on the default `buzz-acp` runtime.
## Reproduction
1. Post an image message to a Buzz channel (Blossom-authenticated CDN).
2. Tag a managed agent that runs via `buzz-acp` + `claude-agent-acp` (default runtime, Anthropic Claude Sonnet).
3. Observe the agent crash with `API Error: 400 Could not process image` in `~/Library/Application Support/xyz.block.buzz.app/agents/logs/__.log`.
Manual verification: `curl -I ` returns 401 unless a Blossom auth header is set. `buzz media get -o /tmp/x.png` works — the Rust CLI uses the Blossom-get-auth flow internally.
## Root cause
In `claude-agent-acp/dist/acp-agent.js` (around lines 5533-5553), image chunks with `chunk.uri` but no `chunk.data` are forwarded to Anthropic as:
```js
{ type: "image", source: { type: "url", url: chunk.uri } }
```
Anthropic then fetches the URL, but no auth header is propagated. `buzz-acp` itself does not pre-fetch or transform Buzz-CDN URLs.
## Proposed fixes (any one is enough)
1. **`--media-prefetch` flag in `buzz-acp`** — pre-download URLs matching a configurable host pattern (e.g. `*.communities.buzz.xyz/media/*`) using the existing Blossom-get-auth flow, and embed as base64 `chunk.data`. Cleanest fix: one place, works for every managed agent.
2. **Upstream pre-fetch fallback in `claude-agent-acp`** — when the image URL host is not on a public allow-list, download first and pass as `chunk.data` (base64) instead of `chunk.source.url`. Could be gated behind an `--auto-download-media` flag.
3. **System-prompt workaround (temporary)** — instruct agents to detect the error and manually run `buzz media get -o /tmp/x.png` via the Bash tool, then re-read. Fragile: the image chunk arrives in the same turn as the error, so the workaround only helps on the *next* turn.
## Environment
- `buzz-acp` (Rust harness, `/Applications/Buzz.app/Contents/MacOS/buzz-acp`)
- `claude-agent-acp` (Node script in `~/Library/Application Support/Buzz/node-tools/bin/claude-agent-acp`)
- macOS 15.7 (Darwin 25.5.0)
- Anthropic Claude Sonnet default
## Workaround we're rolling out today
Option 3 as bridge, waiting on option 1 or 2 for the real fix.
---
Reported on behalf of The Blond Bot team (agentic workforce built on Buzz).
Contributor guide
Research direction
Start with claude-agent-acp/dist/acp-agent.js around lines 5533-5553 and trace the image-chunk path; then inspect buzz-acp's Rust media-get and Blossom-auth flow. Choose and document one prefetch or fallback approach for authenticated CDN URLs. Done means a Blossom-hosted image reaches Anthropic successfully instead of producing the 400 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, rust
- Domain
- authentication, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100