In the DeepSeek Harness (DSH) environment, debugging session context, repairing corrupted log files, or batch-testing assistant messages often requires additional tools. dsh-assistant-message-forge is a dual-sided plugin (Host + Client) that provides capabilities to parse, record, and edit session messages, and supports importing and repairing sessionlogs. The plugin has stopped receiving feature updates; its core capabilities have been inherited by dsh-context-console, but version 0.1.1 is retained for rollback use.
Core Capabilities¶
This plugin mainly addresses session data persistence, dynamic modification, and log repair.
- Context parsing and recording: Fully parses the current session into a
ContextCard, grouped by turn, including turn/step boundaries, user/assistant messages, tool call/result, request headers, and other event types. The parsing results, together with card override settings, are recorded to$DSH_HOME/assistant-message-forge/context-<sessionId>.json. - Context cardization and editing: The “Message Forge” tab displays the card stream and supports dynamic editing of text, reasoning, provider, model, usage, as well as tool names and parameters. Edits are first saved as records, so refreshing the parse does not lose them.
- Apply to session: Supports applying card changes via “Save and Apply to Session” or “Apply to Session”. For user/message, assistant/message, and tool-result, it uses the surface replace strategy to directly rewrite the original messages in the current session, so the model context takes effect immediately.
- Draft management: Supports adding, modifying, and deleting assistant drafts. Drafts are persisted in
drafts.jsonand can be fully injected into the current session. - Sessionlog import and repair: Supports recognizing and importing
.jsonl(.zstd)log files, with an integrity preview. For corrupted logs, it can create a newsession-repaired-*session based on later-write branch override, the official crash closer, and seed validation, while the original log remains read-only.
Installation and Activation¶
The Web UI must be installed as a bundle; bare --patch cannot be used. The dsh.client scanner discovers exports["./client"] by package name, so the browser side must be installed into the profile as a bundle.
# Standalone test profile
pnpm dsh plugin --profile amf-test add D:/codeproject/dsh-plugin/plugins/assistant-message-forge
# Production use (install into the default web profile)
pnpm dsh plugin --profile web add D:/codeproject/dsh-plugin/plugins/assistant-message-forge
Typical Usage¶
- Refresh parsing: Run
context/refreshin the session context to parse the complete events of the current session and record them to a local JSON file. - Editing and injection: Modify content in the card view and choose “Save and Apply to Session” or “Apply to Session” to directly rewrite messages; or use “Inject into Current Session” in the draft area to fully synthesize a turn and flush it.
- Import recognition: Use the
sessionlog/parseinterface to upload base64-encoded sessionlog data, supporting zstd unpacking and packed chunk expansion.
Notes¶
- Maintenance status: The plugin has stopped receiving feature updates and has been inherited by
dsh-context-console. For new deployments, migration to the new plugin is recommended; the existing 0.1.1 version is retained for rollback. - Transfer limit: Uploaded base64 data is limited to within 128 MiB.
- Tool Result limit: When modifying
tool/result, onlycontentmay be edited; wrapper fields such asmessage id,source, andisErrormust retain their original values.isErrorcan be changed in the record, but it is written back with its original value when applied. - Session boundary: If the session is running (there is an unclosed turn), injection and apply operations are rejected.