Introduction¶
DeepSeek Harness (DSH) is responsible for orchestrating agent execution and tool calls, while UniPet is a pet process running on the desktop. The two lack a direct interaction interface. The unipet-dsh plugin fills this gap by listening to DSH agent/session lifecycle events and pushing states such as thinking, tool execution, waiting for approval, or failure to the local UniPet pet through the HTTP API, keeping its state in sync with the actual AI runtime.
Plugin Overview¶
- Name: unipet-dsh
- Maintainer: ztyhehe
- License: MIT
- Purpose: A workflow plugin responsible for bridging DSH and UniPet states.
Core Features¶
- Listens to DSH agent/session lifecycle events.
- Pushes states to the local UniPet pet in real time.
- Supports state mapping (thinking, waiting, failed, review, etc.).
- Automatically runs
unipet startwhen the pet is offline. - Performs periodic health probes, stops pushing while disconnected, and automatically returns to idle after recovery.
- Debounces high-frequency events and supports failure semantic recognition.
Installation and Enabling¶
Run the following command in the DSH web profile environment to install it:
cd ~/.dsh && dsh plugin --profile web add git+https://github.com/ztyhehe/unipet-dsh.git
After installation is complete, restart the dsh web service to take effect.
State Mapping¶
The plugin maps specific DSH events to UniPet states. The mapping is as follows:
| DSH Event | UniPet State | Bubble Text |
|---|---|---|
turn/start |
running | Thinking… |
tool/call |
running | Editing code / Running command / Searching / Delegating |
approval/asked |
waiting | Waiting for your approval |
ask/question |
waiting | Waiting for your answer |
tool/result failure / agent/error |
failed | Task failed |
agent/status idle |
review | Done - ready for review (auto-resets after 8s) |
Configuration Notes¶
The default configuration is sufficient for basic use. To customize it, you can override the plugin’s config field in the profile’s cordis.patch.yml.
- host / port: The HTTP address and port of UniPet, default
127.0.0.1:8768. - source: Event source identifier, default
dsh. - autoStart: Attempt to start the pet when offline, default
true. - debounceMs: Minimum sending interval for the same state (debounce window), default
400ms. - healthIntervalMs: Pet health probe interval, default
30000ms. - aggregate: Multi-agent aggregation strategy, default
true. - softFail: Extended semantic failure recognition, default
true.
Cautions and Limitations¶
- This is a pure host-side plugin and does not include client code. It only accesses the local loopback address and does not send any data externally.
- Before uninstalling, you must manually clean up timers and unsent debounced states.
- If legacy manual mount lines exist in
cordis.patch.yml(name: './plugins/unipet-dsh/index.js'), make sure to delete that insert; otherwise, it may cause duplicate pushes from two instances.
Verification and Troubleshooting¶
If the log shows push failed: request timeout but UniPet is clearly running, this may be a false positive from an older version. v0.2.0 fixed this issue by consuming the HTTP response to avoid socket idle timeout. Make sure to fully restart dsh web before observing.
You can manually verify the push path with the following command to confirm that UniPet is receiving updates normally:
curl -sS -m 5 -w "\nHTTP=%{http_code} total=%{time_total}s\n" \
-X POST http://127.0.0.1:8768/api/pet/events \
-H 'Content-Type: application/json' \
--data '{"source":"dsh","state":"idle","message":"DSH ready","action":"update"}'
Brief Conclusion¶
With the configuration above, DSH’s runtime state is reflected on the desktop pet in real time. For more details, see the project directory page or source code.