dsh-szg-hint: Bypass Hint during Task Execution (Attachable Images)

Preface

When running long tasks in DSH, a common need is “I want to change direction right now, but I don’t want to interrupt the current turn or add a permanent chat record.” The official channels Agent.steer() / Agent.inject() write messages into the conversation history (via agent/inbox/claimed), so they remain visible in the chat area after refresh. If you only want the model to see a supplementary note in the next step, and only once, you need to use pre-step injection rather than appending to history.

Below is the community plugin dsh-szg-hint (maintainer skyyyyyk, category admin-security): host-side queueing and injection plus a Web client entry point, with data plane requests constrained by the host trust fence. Current version 0.2.0; since this version it supports pasting, drag-and-drop, or file picker image attachments, and images enter the next step along with the hint.

What Is This

dsh-szg-hint is a bypass hint plugin for DeepSeek Harness: the user inserts a sentence (with optional image) during task execution, the AI references it in the next step request, the task is not interrupted, and the main conversation history is not polluted. The hint appears only once with a specific step, and the frontend marks it as referenced after receiving a receipt.

Injection goes through agent/pre-step, appended to the current step’s request, without calling session.append; it shares the same kind of hook with memory plugins (after system prompt assembly, before model request), but checks the queue at every step.

Architecturally it splits into two halves: Host (src/index.ts, store.ts, protocol.ts, images.ts) handles the JSONL queue, routes /dsh-szg-hint/*, agent/pre-step injection, and the hint_send / hint_status tools; Client (src/client/) syncs state via SSE (falling back to polling on failure), and provides a light bulb entry point with a pop-up panel to the right of the tool row in the conversation input box. Both sides share the type contracts in protocol.ts.

Core Features

Bypass Injection Semantics

  • Extension point: agent/pre-step waterfall.
  • Injection form: a user message with source plugin:dsh-szg-hint (form: snapshot, segment name “Bypass Hint”), appearing only at the tail of the current step’s message sequence, not written into conversation history.
  • Attribution: matches session hints and global hints (empty sessionId) by payload.agent.session in the pre-step payload; oldest first, up to 20 consumed per step. When the session id is unavailable, only global hints are taken; hints are never fed across sessions.
  • Atomicity: taken items are immediately marked consumed; if injection construction fails, it rolls back to pending and retries on the next step.

Model-visible body example (Chinese hardcoded in the plugin):

📌 Bypass Hint (inserted by the user during task execution, does not occupy conversation history, visible only in this message)
Please refer to the following request in this step, then continue the original task; do not stop to wait for confirmation, and do not treat it as a new user turn.
1. Change the color scheme according to this reference image
   Attached image 1: ref.png (1600x900, image/png, 312 KB)

A single body exceeding 600 characters is truncated in the display layer; the full text is kept in the queue (limit 2000 characters). When the queue is empty nothing is injected, so there is no extra KV cache jitter.

Web Interface (0.2.0)

  • Entry point: conversation.input.right, a 28px round button, with a pending-reference count badge (shows 99+ beyond 99).
  • Input: Enter to send, Shift+Enter for newline; pure image hints show “(Image hint)” in the list.
  • Attachments: paste, drag onto the panel, or pick files; local image-prep.ts compresses before upload; thumbnails can be previewed; Esc closes the preview first, then the panel.
  • Data: SSE GET /dsh-szg-hint/events as primary, GET /dsh-szg-hint/state as polling fallback; connections are dropped when the page is hidden.

Image Hints (0.2.0)

The browser accepts only png / jpeg / webp / gif, with canvas re-encoding when necessary (GIF is not re-encoded; exceeding limits raises an error). Ingestion goes through the host’s ctx.attachments.saveImages; the batch is written to the queue only if all succeed; queue files store only attachment references, and image bytes never pass through hints.jsonl.

Default limits (overridable via cordis config; the frontend reads from the snapshot’s imageLimits):

Key Default
maxImagesPerHint 3
maxImageBytes 4 MiB
maxTotalImageBytes 12 MiB

When the host has no attachment service mounted, imageLimits.enabled = false, the frontend disables image attachments, and plain-text hints are unaffected; if the service becomes ready after the plugin, it is enabled in place without a restart.

If the current step’s model inputModalities does not include image, the core projects the image to placeholder text, and when it can definitively determine “cannot see”, it appends a read-only copy path hint to the body (depending on the attachment service’s imageHostPath).

Persistence and Data Channels

Queue persistence: $DSH_HOME/dsh-szg-hint/hints.jsonl (append-only, put / del; when the line count exceeds 2000 it is compacted to “pending + the latest 20 consumed”). consumed is persisted so hints are not re-fed to the model after a restart.

Main HTTP actions (all subject to the host trust fence):

  • POST /dsh-szg-hint: enqueue, body { text, sessionId?, images? }.
  • DELETE /dsh-szg-hint or DELETE /dsh-szg-hint/<id>: revoke a pending-reference item.
  • GET /dsh-szg-hint/image/<hint id>/<index>: fetch an image by hint id and index (index starts at 0).

Model Tools

Tool Purpose
hint_send Deliver a hint to a specified session, optionally with an array of local image paths
hint_status View pending references, recently referenced, whether running, image capability and limits

Installation and Activation

Environment requirements: dsh >= 0.2.0-rc.2 (0.2.0 message sources use the v4 plugin: namespace; older hosts are unverified); Node ^22.19.0 or >=24.0.0. Image capability depends on the host attachment service.

Pick one of the following installation methods:

# From npm
dsh plugin --profile web add dsh-szg-hint

# From GitHub source (if pnpm ≥10 refuses due to build scripts, authorize the package keys as prompted and retry)
dsh plugin --profile web add github:skyyyyyk/dsh-szg-hint

# Local checkout
dsh plugin --profile web add /path/to/dsh-szg-hint

After installation, restart dsh web. Verify that the plugin is loaded:

dsh --profile web --dump-config | grep dsh-szg-hint

Open the conversation page and confirm there is a light bulb button to the right of the tool row in the input box; if not, compare the dump-config and host log lines starting with [dsh-szg-hint] to troubleshoot.

Common configuration keys (excerpt, all defaults enabled):

Key Default Description
enabled true When off, routes, tools and event subscriptions are not registered
maxPerStep 20 Maximum items consumed per step
maxContentChars 2000 Maximum body length per item
maxPendingPerSession 20 Maximum pending items per session; the oldest is evicted beyond this

License: MIT (see the repository’s package.json).

Typical Usage

  1. While a task is running, open the light bulb, type “Change the color scheme to brand green” and send; the model references it at the next step and continues the original task, and this user message does not appear in the chat area.
  2. After taking a screenshot, Ctrl+V paste into the panel, or drag an image in; you can send pure-image or text-plus-image hints; pending hints can be revoked from the list, and after successful injection a toast at the top right says “AI has referenced your hint”.
  3. Tell the coding agent: “Send a bypass hint to the running task: change the color scheme to brand green” — if this plugin is installed, it can be accomplished with hint_send and related capabilities.

Choosing between the official steer/inject and this plugin: use the official channel when you need permanent history, traceable; use this plugin when you need one-step effect, no history footprint.

Applicable Scenarios and Cautions

Suitable for: temporary course correction during long-turn coding or operations tasks; pointing out UI/error locations with screenshots; token control — only the step containing the hint has one extra message.

Cautions:

  • The plugin runs with the current dsh process’s permissions; review the GitHub source and the MIT license before installation.
  • Both the data plane and image-fetch routes are protected by the host trust fence (unauthorized connections get 401/403); it remains an admin-security capability, so do not expose the Web entry point in untrusted environments.
  • 0.2.0 depends on a relatively new host and attachment service; before upgrading, verify the plugin: namespace and the image-attachment pipeline on a test profile.
  • The community directory skillhub.cn is an independent ecosystem site with no official affiliation with DeepSeek / HF; stars and versions are as in the repository.

Conclusion

dsh-szg-hint turns “changing requirements during execution” into a pre-step bypass: no task interruption, no conversation pollution, and since 0.2.0 it can carry images into the next step. To try it or inspect implementation details, open the directory page and the repository:

  • Directory page: https://www.skillhub.cn/plugins/skyyyyyk/dsh-szg-hint
  • GitHub: https://github.com/skyyyyyk/dsh-szg-hint
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye