AI Agent Hub
Back to plugins
🤖

dsh-media-guard

Model Inference Updated 2026.08.20

Run the following command in DeepSeek Harness:

dsh plugin install spyfree/dsh-media-guard

Paste the following prompt into your AI chat to install this plugin:

In DeepSeek Harness, run dsh plugin install spyfree/dsh-media-guard to install this plugin from https://github.com/spyfree/dsh-media-guard, then restart your profile to activate it.

About this plugin

In a multimodal agent loop, image attachments are often the largest and most unpredictable part of the request payload. DSH 0.1.0-rc.8 already ships an offloadRequestImages safety net that caps aggregate Base64 at 20 MiB by dropping the oldest images first, but that policy is blunt: either a full image is removed or the request overflows. dsh-media-guard layers a finer-grained optimization and retention policy on top so the provider-bound view is shaped before the request leaves the process.

The core capabilities are threefold. First, oversized images are compressed to WebP via sharp and written back through the DSH immutable attachment store; the durable session log and original files are never modified. Second, identical images are deduplicated by their sha256 content address, and later copies become deterministic Evidence Notes carrying hash, size, dimensions, origin, and reason. Third, the plugin registers on the llm/stream waterfall and acts only on agent-loop requests, leaving hand-built calls, compaction, replay, and its own projected re-dispatch untouched. In protect mode the serialized budget is mirrored to the adapter ceiling so the official oldest-first offload normally becomes a no-op.

This plugin is for developers and teams running multimodal agents on DSH who hit image request size limits or want predictable, auditable payload behaviour. It works out of the box with zero configuration, and a compact live status row appears under the DSH home composer showing current pressure, images kept, budget headroom, and compression, deduplication, or externalization counts.

Use Cases

  • Multimodal agent loops where image attachments repeatedly cause request size overflows
  • When you need compression and deduplication instead of dropping images, while preserving current-turn media
  • When you need live visibility into how many images are kept, compressed, or externalized per guarded call

Best For

  • Developers running multimodal agents on DeepSeek Harness
  • Teams that need fine-grained control over Base64 image payload budgets and retention policy
  • Engineers who want request-level observability and audit trails without silently dropping media