Introduction¶
During the development of DeepSeek Harness (DSH), it is often necessary to ask follow-up questions for more detail in the main session, without interrupting the current context flow, and even more important to avoid letting generated responses pollute the token context of the main session. Most existing sidebar plugins have limitations: either they support only a single message bubble and cannot handle multiple follow-up rounds, or they break the prefix cache, causing the inference cost of the main session to increase sharply.
dsh-side-branch is designed to solve this problem. It derives an independent read-only branch from the main session, uses streaming to provide real-time responses, and enforces strict isolation at the execution layer to ensure that answers are never written back into the main session context.
Core Features¶
- Derived Read-Only Branch: Derives a session from the main session, inheriting the context without interfering with each other.
- Streaming and Reasoning: Supports token-by-token streaming output, including the reasoning process.
- Multi-Round Follow-Up: Supports continuous multi-round conversations inside the branch, with the context independently maintained.
- Prefix Cache Optimization: Maintains a prefix cache consistent with the main session through execution-layer isolation rather than prompt modification.
- Execution-Layer Read-Only: Security policies are enforced at the execution layer, rejecting system side effects (such as writing files) while retaining query capabilities like
readandweb_search. - Persistent State: Panel state is persisted locally, supporting resumable follow-up questions.
Installation and Enablement¶
Before installing, make sure that Node.js >= 20 is installed in the local environment and that pnpm has been added to PATH. The plugin requires DSH version 0.1.5-rc.2 or 0.1.7-rc.2.
- Install the Plugin:
dsh plugin --profile web add dsh-side-branch
Or install it from the GitHub repository:
dsh plugin --profile web add github:wucl12/dsh-side-branch
- Restart DSH:
After installation, you must restart the DSH client for the plugin to load correctly.
Usage¶
-
Select Text and Ask:
Select any text in the main session and click the popup “Quote and ask”. This opens a temporary session in the right sidebar. The quoted text is recorded as a collapsed block in the current turn and does not affect the quote slot for the next question. -
Quick Entry:
There is a quick entry button↗on the right side of the main session input box. Click it to open the sidebar panel directly. -
Independent Configuration:
In the sidebar panel, you can separately specify the model and Reasoning Effort used by this branch, without being constrained by the main session configuration.
Notes¶
-
Read-Only Boundary: Read-only here means no system side effects (such as writing files or executing scripts). The
web_fetch,web_search, andreadtools can still be used normally, and the allowlist is hardcoded and cannot be relaxed through settings. -
Context Inheritance Mechanism:
- Each follow-up question reconstructs the context based on the latest settled content in the main session.
- Incomplete turns do not automatically appear in the branch (it falls back to the end of the previous turn), but manually quoting selected text is not subject to this limitation.
- When the context reaches its limit, the plugin rejects that turn and prompts you to clean up; it does not silently discard older turns. -
Prefix Cache Explanation:
A prefix cache hit is a measured value, not a guarantee. Although the plugin keeps the prompt prefix consistent through execution-layer isolation, the platform may replace system nodes in certain situations, causing the cache to become invalid. -
PTC Mode Limitation:
If the main session usesptc(pure code execution tool surface) mode, the plugin force-rejectsrun_code. As a result, the branch falls back to pure text Q&A mode and cannot invoke code execution tools.
Conclusion¶
dsh-side-branch provides a stable tool for safely exploring and asking follow-up questions within the flow of a main session. Through execution-layer isolation and context reconstruction mechanisms, it maximizes prefix cache utilization while ensuring safety.