dsh-codespace-workspace: Use GitHub Codespace as a DSH Workspace

Preface

The plugin-based architecture of DeepSeek Harness (DSH) allows for the extension of local workspace capabilities. The local DSH sidebar typically manages local directories. The dsh-codespace-workspace plugin integrates GitHub Codespaces as virtual workspaces. The Agent operates files and commands inside a cloud-based Codespace rather than connecting to a remote host via SSH. It does not insert anything into DSH’s SSH host list, thus avoiding conflicts with other cloud workspace plugins.

Core Features

Setup and Configuration

A new Codespace panel has been added to the DSH settings page for centralized management of connection parameters and execution strategies:

  • GitHub Username: Used for validation and display; if left blank, the login name is read from the token.
  • Default Branch: Used when creating a new Codespace; defaults to main.
  • Auto-pause Timeout (minutes): Countdown begins after a conversation turn ends; defaults to 30.
  • SSH Key (Optional): Only the path is stored; the value is never echoed back, displaying only “Set / Not Set”.
  • Always Show Cloud Workspace Button: A toggle, default off; when enabled, the button no longer hides on hover.
  • Auto-initialize Empty Repositories: A toggle, default on; empty repositories are committed with a README before creating the Codespace.
  • README Initial Content: Optional; if left blank, an empty README is created.

Settings are persisted via the standard DSH settings storage and do not occupy localStorage.

Workspace List Interaction

The cloud workspace reuses the original workspace’s folder icon position, replacing the folder glyph there with a cloud. The position, dimensions, color, and the “make way for the expand arrow” behavior on hover remain consistent with the original. There is always only one icon at the beginning of the row.

The action button is located at the third-to-last position—before the three-dot menu and the new conversation button. The display logic follows the host’s default behavior, hiding when not hovered; it remains visible when “Always Show” is enabled.

Status Icon Hover Tooltip Click Action
Stopped Play Start Codespace Start
Running Pause Pause Codespace Pause
Countdown Alarm Clock Auto-pause in X minutes Cancel Countdown
Toggling Spinning Switching state… Not Clickable

Double-clicking the clock icon = Pause immediately.

For the workspace currently in use, the cloud icon inherits the host’s folderActive color. The title of the workspace row uses the repository short name (the name part of owner/name).

New Cloud Workspace Flow

Creating a new cloud workspace adopts a step-by-step window flow without stacked pop-ups:

  1. Fetch the GitHub repository list and select a repository.
  2. Check the Codespaces for the repository: Multiple → Select; One → Use directly; None → Create.
  3. Check for prebuilds before creation, adopting tri-state logic:
    • Present → Prompt “Prebuild configured”.
    • Explicitly absent → Prompt “No prebuild configured, creation may be slow”, providing Cancel/Create Directly options.
    • Unreadable → Prompt “Cannot confirm prebuild status, creation may take 1–3 minutes”, providing no buttons (indicating a plugin read failure without forcing an assertion).
  4. Empty repository → Automatically commit an empty README, then proceed with creation.
  5. Machine specifications are optional, defaulting to the minimum.
  6. Startup failure → Error reported within the window, allowing retry.

Lifecycle Management

  • On DSH Startup: Does not automatically start any Codespace. Checks for leftover running Codespaces from the previous session and prompts the user (with a “Stop” button), but does not stop them automatically.
  • On DSH Exit: Attempt to automatically shut down all Codespaces managed by this plugin.
  • Auto-pause: Countdown begins after a conversation turn ends; if the user sends a new message during the countdown → Cancel countdown; Click clock → Cancel; Double-click clock → Pause immediately.

Agent Integration

  • Automatic Readiness Check: Before sending a message, the system automatically checks and starts the Codespace. If the Codespace is auto-paused or starting, it waits until it becomes Available before actually sending the prompt to the model.
  • Git Capabilities: The Agent possesses full git command execution capabilities. The plugin does not interfere with Git operations or wrap push logic. It only injects a rule into the system prompt when creating a session, instructing the Agent to git push back to the repository after completing changes.

Prerequisites

Dependency Required Description
git Yes Used by the Agent to push back to the repository
ssh Yes Data channel for connecting to Codespace
gh (GitHub CLI) Recommended Used for gh codespace ssh; Plugin remains functional if not installed, switching to the SSH alias configured in settings
GitHub Token Yes Control plane (REST API). Value priority: Settings → GITHUB_TOKEN → gh auth token

Required GitHub permission scopes: codespace, repo.

Installation and Activation

The installation command is as follows:

dsh plugin --profile desktop add dsh-codespace-workspace

Note: dsh plugin add only rewrites the profile’s package.json dependencies and pnpm-lock.yaml; it does not register the dsh.profile.bundles array. You must manually edit the configuration:

# 1. Edit %USERPROFILE%\.dsh\profiles\desktop\package.json
# 2. Add "dsh-codespace-workspace" to the dsh.profile.bundles array
# 3. Restart DSH (Plugin file changes do not take effect hot)

You can also install from a local clone (use this when modifying code):

git clone <this-repo> dsh-codespace-workspace
dsh plugin --profile desktop add "link:<absolute-path>\dsh-codespace-workspace"

dsh plugin add will report a peer dependency warning (@deepseek-ai/cordis, @deepseek-ai/schemastery are provided by the host), which can be ignored.

Typical Usage

  1. Configure the GitHub username, default branch (default main), and auto-pause timeout (default 30 minutes) in the DSH settings page.
  2. Click the cloud icon in the workspace title bar to start a Codespace; double-click the clock icon to pause immediately.
  3. When creating a new workspace, the system automatically checks the repository’s prebuild status and warns that creation may be slow if not configured.
  4. Send messages in the Codespace session; if the Codespace is auto-paused or starting, the system waits until it becomes Available before actually sending to the model.
  5. Operate Git within the Codespace; the plugin injects a rule at session creation to prompt the Agent to push back to the repository after completing changes.

Notes

  • Installation Limitation: dsh plugin add only rewrites the profile’s package.json dependencies; the dsh.profile.bundles array must be edited manually.
  • Profile Limitation: The desktop profile is exclusively managed by the Electron application; CLI cannot use --dump-config-schema.
  • Permission Scope: The GitHub Token must possess codespace and repo permission scopes.
  • Fallback Plan: The plugin remains functional without gh installed, switching to the SSH alias configured in the settings page.

Conclusion

Through a design utilizing placeholder directories and routing by cwd, this plugin seamlessly extends DSH’s local workspace mechanism to the cloud. It provides complete workspace lifecycle management and Agent tool integration capabilities, making it suitable for scenarios requiring code development and debugging in the cloud.

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

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

Xiaoye