Introduction¶
DeepSeek Harness (DSH) model context is re-derived from the conversation surface on each invocation. The official “rollback to end” editing style (such as the default behavior of dsh-edit-turn) discards all content following the message being replaced. This is because the assistant/message format explicitly forbids carrying sourceEventSeqs, making in-place replacement impossible.
The dsh-rerun-turn plugin implements “infix rerun” via the official surface-replace contract: it reruns any round of model response while preserving subsequent rounds, so that subsequent calls read the modified historical context.
Core Features¶
- Infix Rerun: Rerun any round of response and preserve subsequent rounds to achieve infix stitching.
- Official Contract: Uses only the official
surface-replacecontract without custom event types, ensuring compatibility. - Silent Carrier: The masking carrier does not occupy turns or steps, and is invisible to the user.
- Replay Fidelity: Event-by-event copying, discarding
usage, embedded streams, system messages, etc., to ensure context consistency. - Crash Recoverable: Interrupted reruns can be recovered based on log state.
- Image Support: Images in the original prompt can be resent.
- UI: Bilingual (Chinese/English), follows the current DSH language, skin-friendly.
Installation and Activation¶
Install from official directory:
dsh plugin --profile web add dsh-rerun-turn
Install from local directory (for development):
dsh plugin --profile web add /path/to/dsh-rerun-turn
Profiles with patchReload: live will hot-reload; otherwise, restart the DSH process corresponding to that profile.
Typical Usage¶
- Hover Trigger: Hover the mouse over the model response you want to rerun.
- Click to Execute: Click the ↻ (rerun this turn) icon in the action bar.
- Background Processing: Execution starts immediately in the background. The old turn and its subsequent content are first removed from the model context, the prompt is resent to the model, and once generation is complete, subsequent turns are automatically replayed.
- Result Display: The retired old lines are hidden in the interface, while the newly generated response and replayed lines appear normally. The final order matches the order read by the model.
Configuration¶
- id: dsh-rerun-turn
config:
confirm: false # Default false: execute with one click
autoResume: true # Default true: automatically resume interrupted reruns when session is idle
idleTimeoutMs: 600000 # Maximum time to wait for new response to land
devTools: false # Default false: /dev/* loopback routes for end-to-end verification
| Field | Default | Meaning |
|---|---|---|
confirm |
false |
Whether the client prompts for confirmation first. |
autoResume |
true |
Whether /state automatically completes interrupted replays when the session is idle. |
idleTimeoutMs |
600000 |
Maximum time to wait for the new response to complete. |
devTools |
false |
Whether to mount verification loopback routes. |
Notes¶
- File Attachments: File attachments are temporarily rejected.
- Carrier Shape: The silent carrier’s content shape is determined by a load-time probe of installed adapters (0.1.27). If it cannot be proven that the adapter drops empty user messages, a zero-width space is used.
- Replay Fidelity: During replay,
usage, embedded streams, system messages, etc., are discarded, retaining only core events. - Security Restrictions: Host routes are limited to local loopback and validate Host and Origin.
Conclusion¶
This plugin maintains the model’s complete context through infix stitching, making it suitable for scenarios requiring fine-grained debugging or localized corrections.