dsh-agent-processes: DeepSeek Harness Local Process and Port Lifecycle Management

Introduction

In a local coding environment, starting long-lived processes via bash often encounters the “zombie process” problem: the agent forgets the process PID, the port remains occupied, and the next startup encounters an EADDRINUSE error. This often leads the agent to misdiagnose it as a code logic error, when in fact it is just a port conflict.

Overview

dsh-agent-processes is a plugin for the DeepSeek Harness Web UI, maintained by janpauldahlke, designed to provide full lifecycle management for host-owned processes and ports. It offers first-class control capabilities for agents, including start/stop/list/logs/wait-for-ready, and provides a persistent storage view and interactive panel via the UI.

Core Features

This plugin provides the following core capabilities:

  • Process Control: Supports process_start, process_stop, process_list, process_logs, process_wait_ready, and process_ping.
  • Port Reclamation: When starting a process with a port, it automatically reclaims tracked port occupiers; for untracked holders, the plugin refuses the connection rather than killing the process directly.
  • UI Panels:
    • Processes Rightbar: Follows the chat workspace, displaying status dot, ID/Port, PID/Runtime, command, working directory, log preview, and providing Kill/Restart/Clear buttons.
    • Dock Chip: When the right bar is closed and there are running processes in the workspace, it displays a chip hint (e.g., Processes · :3000); clicking it opens the panel.

Installation and Enablement

Installing this plugin requires the DeepSeek Harness Web configuration profile (dsh web) and Node.js environment version ≥ 20.

dsh plugin --profile web add dsh-agent-processes

After installation, restart dsh web or rely on hot updates to load the plugin, and perform a hard refresh in the browser to load the client code.

Typical Usage

In agent workflows, use the tools provided by the plugin instead of raw Shell commands and sleep to avoid port conflicts and process loss.

  1. Start Process: Use process_start to start a process. If the process listens on a port, the port must be included in the parameters.
  2. Wait for Ready: Use process_wait_ready instead of sleep. It polls until the port is connectable (or times out), ensuring the process is ready to receive traffic.
  3. Check Status: Before assuming the port is idle, use process_list to check the currently tracked process records.
  4. Stop Process: Use process_stop to stop the process.

Use Cases and Notes

  • Use Cases: Local development servers, file monitoring services, long-running Node.js services, and other processes that need to remain running.
  • Security Restrictions: The plugin can only terminate PIDs it tracks; for untracked external processes occupying a port, the plugin will refuse the connection (refused) instead of forcibly killing the process. Users need to manually clean up these external processes or switch to another port.
  • Known Limitations: The plugin does not include log rotation; logs are in append mode; crash detection relies on liveness probes rather than signal listening; there is no session-based isolation, and the repository is specific to the Web configuration profile.

Conclusion

dsh-agent-processes solves the pain points of process lifecycle management in local coding environments, ensuring port availability and process controllability. By providing a standardized tool interface and an intuitive UI, it makes agents more stable when handling long-running tasks.

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

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

Xiaoye