Introduction¶
When performing session branching with DeepSeek Harness (DSH) version 0.1.5, a forked child session inherits the log prefix of its parent session. If the parent session has an unprocessed queue (i.e. agent/inbox/spliced events), those events are replayed into the child session’s pending queue. As a result, the question you enter in the new branch is appended after the inherited queue, causing the child session’s first turn to run the parent session’s older question first, while your newly entered question appears to have “disappeared.” This plugin is implemented as a host-side bundle and requires no changes to the core code.
Plugin Information¶
- Name: dsh-branch-inbox-guard
- Function: Removes queued prompts inherited by forked child sessions from their parent session, allowing the new branch to prioritize your input.
- Maintainer: xine2009cn
- License: MIT
Core Functionality¶
The plugin checks the pending queue every time an agent/created event is triggered and removes events inserted within the inherited session prefix (seq < session.inheritedEventCount). Specific behavior is as follows:
- Remove inherited items: For queue items inserted before the fork point, persistently remove them as
agent/inbox/splicedcancellation events. - Preserve own items: Leave events generated by the session itself unchanged.
- Support subagents: Supports subagent scenarios under
fork-context, preventing their queues from being polluted by the parent. - Idempotent and conservative: Does not modify session history, does not write external files, and only acts when the source is confirmed to be the parent.
Installation and Enablement¶
Install from the npm registry; no build steps are required.
dsh plugin --profile web add dsh-branch-inbox-guard
After installation, restart the DSH process (for example, docker restart <container>) and reload the Web GUI. The plugin must be listed in the profile’s dsh.profile.bundles configuration to be loaded at startup.
Typical Usage¶
- Queue a message in a session while the Agent is running.
- Fork a new branch from a completed turn.
- Check the new branch’s queue; the inherited old messages should already be cleared.
- Enter a question in the new branch; it should start running immediately instead of waiting for the parent’s older messages.
Log verification:
When the plugin removes queue items, the DSH log will contain the following record:
[branch-inbox-guard] session-xxxxxxxx: dropped 5 inherited prompt(s) from its fork parent
Compatibility and Notes¶
- Version compatibility: Verified with DSH 0.1.5-rc.1 and 0.1.5-rc.2. On DSH 0.1.1-rc.2, the queue is empty at the time of forking, so the plugin remains a no-op.
- No configuration: No additional configuration is required.
- Permissions: The plugin runs with the current DSH process permissions. It is recommended to review the source code and license before installing.
Conclusion¶
dsh-branch-inbox-guard provides a non-invasive solution to fix the issue in DSH version 0.1.5 where a forked branch inherits the parent’s queue, causing new input to be blocked.
- GitHub: https://github.com/xine2009cn/dsh-branch-inbox-guard
- DSH ecosystem catalog: https://www.skillhub.cn/plugins/xine2009cn/dsh-branch-inbox-guard