Introduction¶
When handling multiple Pull Requests, DeepSeek Harness (DSH) agents have no memory feature; each query requires re-fetching data from GitHub. This leads to duplicate API calls and context redundancy. The dsh-pr-watch plugin aims to resolve this issue by storing snapshots and reporting incremental changes, allowing agents to focus only on “what happened recently”.
Overview¶
The plugin works by registering a tool named pr_watch. Core capabilities include:
- Cross-repository tracking: Track all Pull Requests that you authored, without locally cloning repositories.
- Status reporting: Distinguish and report PR status changes, including merged, closed without merging, and becoming stale.
- Incremental updates: Based on the previous snapshot, report only new or changed statuses.
- Reopened handling: Identify Pull Requests that were closed and later reopened.
- Deduplication: Merged and stale statuses are not repeatedly reported in subsequent checks until their status fundamentally changes again.
Installation and Enablement¶
The plugin is currently in pre-release status and has not been published to npm, so the official installation command is temporarily unavailable.
Official installation command (to be published):
dsh plugin --profile PROFILE add dsh-pr-watch
Current installation method:
After checking out the source repository, build it first, then install it via a local link.
pnpm install && pnpm run build
dsh plugin --profile PROFILE add link:.
Dependencies and Environment¶
Before installation, ensure the environment meets the following requirements:
* Node.js: Version must be 18 or higher.
* GitHub CLI (gh): Must be installed in PATH and authenticated via gh auth login.
* Credential handling: The plugin does not store any credentials and relies entirely on the gh keyring authentication mechanism.
Usage¶
You can check PR status by invoking the pr_watch tool. Pass parameter configuration when calling it.
Invocation example:
{
"staleDays": 14,
"all": false
}
Parameter description:
* staleDays: Integer type; the number of days after inactivity before a PR is marked as stale. Defaults to 14. Range is limited to 1 through 3650; 0 is rejected.
* all: Boolean type; when set to true, list all open PRs instead of only changes. Defaults to false.
Output example:
The plugin outputs PRs in three status categories:
✅ Merged (2):
octo/repo#41 — Add Russian locale (last activity 1 day ago)
octo/repo#38 — Fix broken link (last activity 3 days ago)
⏳ Became stale (1):
octo/repo#29 — docs: clarify install steps (last activity 21 days ago)
🆕 Newly noticed (1):
octo/repo#44 — Add MCP server entry (last activity today)
Working Principles and Notes¶
The plugin adopts a two-phase query strategy:
1. Enumeration: Retrieve all open PRs that you authored.
2. Resolution: Compare the current set of open PRs with the previous snapshot, identify PRs that are no longer in the current set (i.e., closed or merged), and query their final status separately.
Because it needs to distinguish between “merged” and “closed without merging”, a simple diff is insufficient. The plugin ensures accurate status reporting through this mechanism.
Notes:
* The plugin relies only on the gh CLI for authentication and does not save tokens; security is guaranteed by the gh keyring.
* For repositories that are not cloned, the plugin tracks them using the owner/repo#number format, so local checkout is not required.
Summary¶
dsh-pr-watch provides DSH agents with an effective capability to track PR changes, reducing the overhead of repeated checks. The implementation is complete and tests pass, but it has not yet been published; it must be installed and used from source.