dsh-local-long-horizon: Long-Horizon Task State Management for Local Coding Agents

Local coding agents often rely on loose STATUS.md maintenance conventions when handling long-horizon tasks. This approach can easily lead to state discrepancies, chaotic file structures, and wasted tokens due to frequent file reads. The dsh-local-long-horizon plugin transforms this process into a host-managed, structured Vault and provides validated Agent tools to ensure task state is visible and maintainable within the DeepSeek Harness Web UI.

Core Features

The plugin provides the following core capabilities:

  • Host-Managed State: State is stored on the host side, rather than relying on the Agent to maintain files itself.
  • Structured Vault: Data is stored in a JSON-formatted Vault, with STATUS.md serving as a one-way projection.
  • Tool Validation: Provides a set of validated Agent tools for reading and writing state.
  • Injection File: Provides a minimal injection file for resuming context.
  • UI Integration: Provides a “Long horizon” panel in the right column and chip displays in the Composer dock.
  • Agent Toolset: Includes tools for initialization, fetching, setting next steps, setting in-flight status, completion, blocking/unblocking, and toggle control.

Installation & Activation

Installing the plugin requires using the DeepSeek Harness Web Profile.

  1. Execute the following command in the terminal to install the plugin:
dsh plugin --profile web add dsh-local-long-horizon
  1. After installation, restart the dsh web service to load the plugin. Once restarted, refresh the browser page to see the new features.

Typical Usage

Once enabled, the Agent can manage task state via tool calls.

  1. Initialize: Use status_init to enable long-horizon tracking.
  2. Set Next: Use status_set_next to replace items in the Next list (limited to 0-3 items).
  3. Set In-flight: Use status_set_inflight to mark the task currently being executed; a non-empty summary is required.
  4. Mark Done: Use status_mark_done to record completed tasks; including a verify field is recommended.
  5. Maintain AGENTS.md: Keep an AGENTS.md file in the project root as “glue”. DSH injects this into the Agent instructions to guide the Agent to read the injection file and use the status tools.

Agent Tool List

Tool Name Function
status_init Create or refresh the Vault to start long-horizon tracking
status_get Retrieve the complete structured record
status_set_next Replace the Next list (max 3 items)
status_set_inflight Set the current in-flight task
status_clear_inflight Clear the in-flight task
status_set_phase Set a short-horizon phase label
status_mark_done Mark a task as done (can include verify and rotateNext)
status_block / status_unblock Mark or unmark blocked status
status_set_enabled Enable or disable long-horizon tracking
status_ping Probe Host health status

Notes & Architecture

System Requirements

  • Node.js: Node.js >= 20 must be installed.
  • DSH Version: Verified compatible with DeepSeek Harness 0.1.7-rc.2.

Limitations & Constraints

  • Next Limit: The Next list can hold a maximum of 3 items; a fourth will be rejected.
  • In-flight Requirement: When setting an in-flight task, the summary field cannot be empty.
  • Done Record: When marking as done, the verify field is recommended; its absence will only trigger a warning.
  • Toggle Control: When tracking is disabled, all state-modifying tools will refuse execution, and the injection file freezes to a single line DISABLED.
  • Sync Notice: Sync notices (such as git branch changes) are displayed only in the panel, not on the Dock chip.

Data Flow

  • Vault: The data source is ~/.dsh/storages/dsh-local-long-horizon/<taskId>.json.
  • Injection File: The bound state file actually read by the agent is <cwd>/.dsh/task-status-inject.md.
  • Markdown: <cwd>/STATUS.md is generated based on Vault content and overwritten on every change.
  • No File Dependency: The plugin has no read dependencies on the host filesystem; tools are registered via the ctx.tools service provided by DSH.

Summary

dsh-local-long-horizon solves the state tracking problem in long-horizon tasks by transforming state management from an Agent’s “soft convention” into a host’s “hard structure”. Combined with the DeepSeek Harness Web UI, it provides developers with a visualized task board and a reliable state write-back mechanism.

Plugin Directory | GitHub Repository

羽毛球分组比赛记分
小程序二维码

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

Xiaoye