description: "The image offload executor for deployments composing compaction: what happens when an image-capable route rejects a request as over its image budget."
English | 中文
Image-heavy conversations continue when older images exceed a model route's budget. The plugin permanently replaces those images with text naming each attachment and its available read-only path, then retries without spending the provider retry budget. Later requests retain that choice across route changes, resume, and replay. Token accounting follows the logged selections, and provider cache reuse ends at the first changed message.
Mount this plugin in every composition that runs the agent loop with an image-capable route. The shipped dsh base does. Without it, an IMAGE_OFFLOAD_REQUIRED failure reaches ordinary recovery and ends the turn as an error. The plugin has no configuration: the DeepSeek adapter enforces its file-mode and inline-fallback budgets, the pi-ai adapter its base64 bound, and each reports the count it needs offloaded.
- name: '@deepseek-ai/dsh-compaction-image-offload'
Each decision appends one image/offload event identifying the selected occurrences by current message-event sequence and depth-first image index. The message events and surface node identities remain unchanged. An agent retry follows a fresh request/header identifying a new message series. Summary retries remain inside the same compaction bracket.
The plugin acts only on IMAGE_OFFLOAD_REQUIRED failures that carry offloadImages. It walks the surface in model request order, skips assistant nodes and images already marked, and marks that many occurrences. When nothing remains to offload it delegates on the agent/request-error waterfall, so downstream recovery or the ordinary turn error applies. The retry spends no provider retry budget and logs no llm/retry event.
ImageBlock.offloaded, IMAGE_OFFLOAD_REQUIRED, and the placeholder projection.Every selected image occurrence reaches the model as placeholder text (offloadedImageText) naming the attachment and its available read-only path; unselected occurrences stay images. Selections persist across requests. A new tool read may introduce a new occurrence of the same attachment without restoring the old one.
An offloaded occurrence costs its placeholder text instead of visual tokens. The token meter applies the logged selections when pricing each node. Reference-only heuristic counts exclude offload metadata.
A selection turns earlier images into placeholder text, so provider cache reuse ends at the first changed image for that request. The selected occurrences remain omitted afterwards.