docs/design/session-media-references.md
Image prompts currently repeat base64 data in request JSON, pending queues, SSE events, and the replay ring. Mid-turn batches amplify this because several images can be emitted in one event.
The daemon stores uploaded image bytes in a session-owned temporary directory and returns a small media reference:
{
type: 'image';
mediaId: string;
mimeType: string;
size: number;
}
Prompt and mid-turn APIs accept these references. Queues, reconciliation snapshots, SSE events, and persisted user-message metadata retain only references. Immediately before an ACP prompt or mid-turn drain crosses into the child, the bridge resolves references to the protocol's inline base64 content blocks.
The TypeScript session client hydrates references in replay/live events and queue snapshots through the authenticated media download route. Existing UI reducers and renderers therefore continue receiving their current inline image shape without carrying base64 through the daemon event bus.
Legacy inline media remains accepted and echoed unchanged for older clients. Media-reference-capable clients avoid placing those bytes in the replay ring.