dsh-pr-chip: Display Pull Request Status in the DSH Session Line

Preface

When using DeepSeek Harness (DSH) to open multiple sessions simultaneously, the sidebar often displays only the title and workspace path. It is difficult to tell at a glance whether a specific conversation has already created a PR, if it is still open, or if it has been merged. To confirm the status, you typically have to switch back to the terminal to check the branch or open GitHub yourself. The dsh-pr-chip introduced below is a community-maintained DSH client plugin. It reserves a fixed slot before the title of each session row, using a small icon to indicate the four states of an associated PR: open, draft, merged, and closed. The color scheme matches GitHub, and the graphic style references the badge in the Codex desktop application.

What is this

dsh-pr-chip (GitHub: N-o-c-t-i-s/dsh-pr-chip, maintained by N-o-c-t-i-s) is categorized as a client plugin in the SkillHub directory. In one sentence, its purpose is to draw PR status chips in the leading area of each session row in the DSH sidebar. The host side is responsible for parsing “which repository, which branch, and the current PR status corresponds to this session,” while the browser side is responsible for rendering the 16px icon; the session records themselves do not persist PR status, only identity is recorded, and status is queried every time (with an in-memory cache).

How it works

The status resolution chain can be summarized as follows:

sessionId ──resolve cwd──> (ownerRepo, branch) ──gh pr list --head──> state

The cwd is first looked up in storages/workspace.json for the workspace belonging to that session; if missing, it is inferred from the session’s directory name on disk (including ~XXXX escaping, splitting hyphens by real paths, etc.). This accommodates cases where “the session cwd is not equal to the workspace path” or where workspace records have been deleted but the session remains.

The in-memory cache uses cwd as the key: if a PR exists, the answer is cached for 30 seconds; if “no PR,” it is cached for 60 seconds. Multiple sessions in the same workspace share a single query. In-progress queries are deduplicated, and the maximum number of concurrent subprocesses is 4.

Where identity comes from (by priority)

  1. Current worktree: Session cwd → git branch → gh pr list --head
  2. Identity remembered in links.json: May still hit when the checkout directory is archived or deleted.
  3. Session events: Observing gh pr create on the event bus and pairing it with the output of that call.
  4. One-time backtracking: For sessions existing before installation, scan the transcript once, write the result, and do not repeat the scan.

Items 3 and 4 only accept the bare PR URL returned by the gh pr create command itself; simply echoing a link in the terminal or a URL mentioned in the text will not be treated as an identity source.

Core Features

  • Four-state display: open, draft, merged, closed; with colors #1f883d, #6e7781, #8250df, and #cf222e respectively.
  • Display position: Extension point sidebar.session.row.leading, i.e., a 16px cell before the session title; DSH only renders this cell when the row is idle. Archived rows or blank rows do not show it. The README explains that DSH does not have a slot “permanently after the title,” making leading the only suitable position for a permanent chip.
  • When no PR or unresolvable: The endpoint returns state: null and a reason (such as no-branch, no-pull-request, workspace-missing, gh-failed). The session row appearance remains consistent with when the plugin is not installed.
  • Offline: When gh cannot connect to GitHub, if the status has been successfully resolved previously, it returns the saved status on disk and marks stale: true; failed queries do not overwrite existing good statuses. Sessions that have never resolved a PR still do not show a chip.
  • The plugin writes to $DSH_HOME/pr-chip/ creating links.json (session → identity, max 500 entries), scanned.json (sessions that have undergone transcript backtracking), and host-loaded.jsonl (host startup diagnostics, one entry per line).

Installation and Activation

Environment requirements:

  • DSH ≥ 0.2.1 (requires support for sidebar.session.row.leading and passing { sessionId })
  • git and gh on the system PATH, with gh auth status working correctly

Installation commands (excerpted from the repository README):

# Local directory
dsh plugin --profile <profile> add link:/path/to/dsh-pr-chip

# From git
dsh plugin --profile <profile> add github:N-o-c-t-i-s/dsh-pr-chip

After installation, you must restart the DSH host: the bundle list is assembled at startup.

If installing within the DSH desktop application, the README notes that the app manages profiles itself. dsh plugin may refuse the operation, requiring manual addition of dependencies, dsh.profile.bundles entries, and node_modules symbolic links.

The current package version is 0.1.6, License MIT.

Typical Usage and When Not to Show

After installing the plugin and restarting, no additional configuration is needed: for sessions inside a git worktree where the current branch is not a detached HEAD and a corresponding PR exists (or identity can be obtained via links.json / events / backtracking), a status chip will appear before the title.

The chip will not be drawn in the following cases (consistent with the README):

  • The directory is not a git worktree (temporary paths are acceptable, but must function as a worktree)
  • The branch is a detached HEAD
  • The branch has no PR, and there is no remembered identity
  • gh is not installed or not logged in

Use Cases and Notes

Suitable for developers who frequently run multiple repositories or branches in parallel within DSH and are accustomed to managing PRs with gh: the sidebar allows distinguishing between “PR still open” or “Merged,” reducing the need to switch back and forth between terminals or browsers.

The plugin runs with the permissions of the current DSH host process, calling git, gh, and reading/writing $DSH_HOME/pr-chip/. Before installing, it is recommended to read the source code and MIT license of the GitHub repository. The community plugin directory SkillHub entry is an independent site and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-pr-chip condenses the four states of a PR into the leading cell of the session row. Status is not stored in the session database, queries are cached, and the last known status is preserved as much as possible when offline. For installation commands and behavioral details, please refer to the README; Directory page: https://www.skillhub.cn/plugins/N-o-c-t-i-s/dsh-pr-chip, Source code: https://github.com/N-o-c-t-i-s/dsh-pr-chip.

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

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

Xiaoye