Preface

After executing dsh web in the terminal to start the Web profile, DSH defaults to opening a normal tab in the system’s default browser to host the GUI. This tab gets mixed in with daily browsing, has no independent window identity in the taskbar, and is inconvenient to switch to or find. DSH’s philosophy is “everything is a plugin,” and this problem can also be solved by a plugin: dsh-auto-open-web is a resident plugin that, after the HTTP service binding is complete and the actual listening port is obtained, automatically opens the GUI in an independent application window (or a browser --app window), and provides a configuration card in Settings → Plugin Configuration. Below is an introduction to its behavior, configuration, and installation methods.

What is it

dsh-auto-open-web is a DSH plugin maintained by jinsiyu under the MIT license. One-sentence positioning: It is a resident plugin that automatically opens an independent application window (or web page tab) after the dsh web profile is started; it includes a bundled WebView2 host (DshAppWindow.exe) for lightweight desktopization.

It is a bundle: dsh.bundle in package.json declares the configuration layer file cordis.patch.yml. After installing into the web profile, the plugin line (name: auto-open-web) is activated by package name.

Relation to official default behavior: After installing this plugin, the plugin’s bundle patch sets web-runtime.openBrowser to false, and the opening behavior is taken over by the plugin; after uninstalling the plugin, the official default behavior is restored.

How it works

Trigger Timing

The plugin declares webServer as a hard dependency (inject). DSH activates this plugin only after webServer initialization is complete (HTTP service binding, port writing), so the port is available when the plugin activates, and no polling is needed. The port is taken from the actual listening value of the webServer service; both custom ports via --port and --port 0 can get the correct result.

WebView2 Host (windowKind: webview2, default, Windows only)

  1. Launches the bundled DshAppWindow.exe (WinForms + WebView2, independent process, no tab bar/address bar), directly loading the GUI root address;
  2. Taskbar/window icon is the DSH icon;
  3. Closes with DSH exit: The host monitors the parent process PID; when the DSH process ends, the window closes together;
  4. Remembers window size/position/maximized state (%LOCALAPPDATA%\DeepSeekHarness\window-state.json), saves on close and restores on start.

Browser Application Window (windowKind: browser)

Starts Edge/Chrome dedicated instances with the --app parameter and --user-data-dir=~/.dsh/<browser>-app-profile; the process tree and storage are independent and not shared with normal browser pages.

Closes with DSH exit (including force kill): The dedicated instance joins a Job Object (JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, driven by koffi). When DSH exits normally, is force-killed by taskkill /F, crashes, or the system shuts down, the instance ends with it. There are two fallback layers for exit cleanup and next-start pre-cleanup.

Fallback & Suppression

  • When the selected window type is unavailable (host missing, browser not found, non-Windows, etc.), it falls back to opening in the system default browser (the same open method as the official behavior, a normal tab) to ensure the GUI can be opened at least;
  • dsh web --no-open or SSH sessions do not open any window/page: The plugin reads the same source as the official webStartup service to perform the same suppression.

Configuration

There are two equivalent ways to configure:

  1. Settings page card (Recommended): Settings → Plugin Configuration → “Auto Open Web Page” card, editable for appWindow, windowKind, browserPath, exitOnWindowClose;
  2. Line configuration: Edit in cordis.patch.yml, acting as the startup seed, takes effect before the settings card saves.

Default values for the four configuration items:

Field Default Value
appWindow true
windowKind webview2
exitOnWindowClose false
browserPath ''

browserPath is used to manually specify the browser executable path (only for browser mode). The settings card provides two helper buttons:

  • “Browse”: Pops up a native file dialog (subprocess + koffi driving IFileOpenDialog);
  • “Test”: Actually launches a --app dedicated test instance (independent user-data-dir ~/.dsh/<browser>-test-profile, does not pollute the official instance), and automatically ends the test process tree after a few seconds.

exitOnWindowClose is an experimental feature, disabled by default, and only takes effect when appWindow is enabled: triggers process.exit(0) when the window process exits normally (user closes the window); non-zero exit codes (start failure, crash, force kill, etc.) do not trigger it to avoid accidental exits.

browserPath line configuration example (~/.dsh/profiles/web/cordis.patch.yml):

- id: auto-open-web
  config:
    browserPath: 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'

This step is the syntax for specifying the executable file for browser mode: Overwrites the corresponding config field according to the plugin line id auto-open-web.

WebView2 Host System Requirements (webview2 mode only)

  • Windows 10 1803+ / Windows 11 / Windows Server 2016+ (Win7/8.1 support ended Jan 2023);
  • WebView2 Runtime (Evergreen, usually pre-installed with Edge; README records verified local 151.x);
  • No .NET 10 runtime requirement: Since 0.1.15, the host targets .NET Framework 4.7.2, which is included with Windows 10 1803+ / Windows 11.

Installation & Uninstallation

npm registry installation:

dsh plugin --profile web add dsh-auto-open-web

Other installation methods (choose one):

# tarball (README example, filename depends on actual packaging artifact)
dsh plugin --profile web add ./dsh-auto-open-web-0.1.5.tgz

# source checkout (during development, changes take effect immediately; use absolute path)
dsh plugin --profile web add C:\path\to\dsh-auto-open-web

# GitHub source
dsh plugin --profile web add github:jinsiyu/dsh-auto-open-web#main

Uninstall (removes dependencies and corresponding configuration layer):

dsh plugin --profile web remove dsh-auto-open-web

Restart dsh web to take effect after installation; the “Auto Open Web Page” card will appear on the settings page.

Note the differences in installation artifacts:

  • The npm package includes the WebView2 host compiled artifacts;
  • The GitHub main branch and source checkout method do not contain host-publish/ (build artifacts ignored by .gitignore); for webview2 mode, you need to run pnpm run build:host under node_modules/dsh-auto-open-web first (requires .NET SDK); browser mode does not require building.

When packaging yourself, run pnpm pack in the source directory; the prepack hook will first compile the WebView2 host (dotnet publish) and output a tgz file.

Implementation Details

  • Zero dependencies: Runtime dependencies are provided by DSH deployment, declared as optional peer. @deepseek-ai/dsh declares compatibility range >=0.1.0-rc.8 <0.2.0 (no runtime version check); @deepseek-ai/schemastery ^3.18.1; koffi is only used for Windows Job Object, process validation, and native dialogs, resolved at runtime against the deployment copy; failure only causes fallback.
  • Settings card UI is fully drawn (since 0.1.10), appearance aligned with official design token variables (--dsw-alias-* / --dsw-static-*), automatically follows light/dark themes.
  • WebView2 host window/taskbar icons come from the DSH .ico generated by the plugin (~/.dsh/auto-open-web-icon.ico, cached and fixed since 0.1.14, reused directly in subsequent starts); the host exe also falls back to an embedded icon via <ApplicationIcon>.

Use Cases & Precautions

Suitable For:

  • Users running dsh web on Windows who want the GUI to appear in an independent window, have a taskbar icon, and exit together with the DSH process;
  • Users who want lightweight desktopization and do not want to install extra runtimes (the host exe is distributed with the plugin package, and the target .NET Framework 4.7.2 is built into the system).

Precautions:

  • macOS/Linux: webview2 mode is unavailable, will fall back to opening in the default browser; browser mode is untested;
  • Under browser mode, old windows remain after restarting DSH and need manual refresh; they may coexist briefly with new windows; under webview2 mode, the old host window closes with the old DSH process;
  • exitOnWindowClose is an experimental feature, disabled by default;
  • The plugin does not perform DSH version runtime checks; confirm your DSH version falls within the declared compatibility range >=0.1.0-rc.8 <0.2.0 before installing;
  • The plugin runs with the privileges of the current dsh process; check the plugin source code and license (MIT) before installing.

Conclusion

After the above steps, the opening behavior after dsh web starts changes from “finding a tab in the browser” to “automatically popping up an independent application window”: window identity, icon, and exit behavior are aligned with the DSH process. Configuration includes both settings page cards and line configuration, and scenarios where it can’t be done (non-Windows, missing host) silently fall back to the default browser.

  • Community plugin directory page: https://www.skillhub.cn/plugins/jinsiyu/dsh-auto-open-web
  • GitHub repository: https://github.com/jinsiyu/dsh-auto-open-web

It should be noted that the directory above is an index page on an independent community site and has no official affiliation with DeepSeek / Huafang.