Keep the consumers separate.
Stable JSON for Code Mode and programmatic callers.
Text and image blocks for the next model request.
Durable call/result identity and replay lifecycle.
Business-owned row registered under the exact wire name.
Wire the user path explicitly.
Scope one component to each controlled image tool name.
Read only durable image references owned by that call.
Use Session authorization, then create and revoke a safe Blob URL.
Context injection changes model transcript semantics and renders through a compact context row. Keep the artifact attached to the tool call that produced it.
Fail safely and visibly.
Missing, corrupt, oversized, unsupported, or unauthorized attachments must leave readable fallback text without crashing Chat. Abort loads on Session change, revoke object URLs, and keep provider credentials and local paths out of the DOM.
Primary evidence.
- Corrected report #4706
- Assistant-image proposal #2995
- Client tool-view contract
- Working community reference
Keep model and UI truth aligned.
The complete guide covers Host output, client slot registration, authorized attachment retrieval, package lifecycle, failure routing, security boundaries, and fourteen acceptance tests.
Read the complete guide