dsh-enter-approve: Approve pending authorization requests with global Enter on the Web

Preface

When developing agents in DeepSeek Harness (DSH), operations such as tool calls and file access often trigger authorization confirmation prompts. The official UI component @deepseek-ai/dsh-client-ui-approval allows you to press Enter to approve when focus is already inside the confirmation card; however, after the panel takes over the composer, focus often lands on document.body, where Enter does nothing — you have to click the card or Tab into the panel first. If you are accustomed to the interaction in products like Codex, where “you can press Enter to approve from anywhere when there is a pending confirmation,” this gap repeatedly interrupts your workflow. The community plugin dsh-enter-approve (maintainer mad-zero-mess, category admin-security) specifically addresses this: in the Web configuration, it triggers approval with a bare Enter under appropriate conditions for visible pending authorization requests, without requiring you to move focus first.

What Is This

dsh-enter-approve is a community plugin for the DSH Web client (dsh.client.platform is web in package.json). It does not modify DSH core files; instead, it injects approximately 90 lines of client/client.js through the documented window.__ModuleLoader__ client contract and the same dsh.bundle.patch mechanism used by other community plugins: it registers a capture-phase keydown listener on document, and when “focus is not inside the confirmation panel, yet there is indeed a visible pending item on the interface,” it clicks the approve button on your behalf; if focus is already inside the panel, it exits immediately and hands over to the official handler, so behavior is identical to that of not having the plugin installed.

Division of Labor Between Official UI and the Plugin

The official approval component handles key presses within the React tree and includes guards such as “the event must have originated within the panel” (the README references a check similar to event.currentTarget.contains(document.activeElement)). Synthetic events are dispatched along the React tree, and when focus is on body, Enter never reaches the handler inside the panel. The plugin only intervenes in the one case where “the native path has already failed”: it captures Enter globally, then clicks the last still-enabled control in the action row whose text is not a known “deny” label, thereby reducing the risk of accidentally clicking deny.

Core Behavior (Verified)

Situation Result
Pending item exists, focus is outside the panel Enter approves
Pending item exists, focus is already inside the panel Official logic unchanged
Currently typing in an input / textarea / select / contenteditable Not intercepted
IME composition in progress Not intercepted
Enter with Ctrl / Alt / Shift / Meta Not intercepted
Prompt already responding (aria-busy) Ignored
Hidden prompts from other sessions Ignored
Esc Never intercepted

When deciding “whether to act,” auto-repeat is also excluded. The plugin cannot execute arbitrary commands or read files on your behalf; it can only simulate clicking the approve control when there is already a visible pending authorization.

Installation and Activation

Requires a DSH version satisfying engines.dsh: >=0.2.0-rc.2 (see the repository’s package.json). The installation command follows the README:

dsh plugin --profile web add dsh-enter-approve

After restarting the host process, confirm that the plugin entry appears under Settings → Plugins. To uninstall:

dsh plugin --profile web remove dsh-enter-approve

Disabling the plugin restores stock behavior without rewriting any DSH core files on disk.

Typical Usage

  1. Install and restart DSH under the Web profile.
  2. Trigger an operation that requires user approval (e.g., a tool permission), causing an authorization card to appear as a composer takeover.
  3. Do not click the card, and do not Tab into the panel; press Enter once (without modifier keys) while not in a text field — this should be equivalent to clicking approve.
  4. If you are already operating inside the card, or are typing in an input field, behavior should be the same as without the plugin installed.

There is no additional configuration file; the implementation is concentrated in a hand-written client bundle with no third-party dependencies.

Use Cases and Notes

  • Suitable for: Users who develop long-term in the DSH Web client, frequently encounter authorization prompts, and want keyboard flow consistent with the Codex-style “global Enter to approve.”
  • Scope: Only the Web profile (--profile web); CLI or other profiles are not within the client platforms declared by this plugin.
  • Security and trust: The plugin runs with the permissions of the current DSH process; before installing, it is recommended to read client/client.js and the license (MIT) on GitHub. It only handles bare Enter and clicks the approve control only when there is a visible pending item; it is still a third-party community extension, and the community directory site has no official affiliation with DeepSeek / High-Flyer. You should judge for yourself whether to incorporate it into your workflow.

Conclusion

dsh-enter-approve uses a minimal client patch to fill the UX gap where “Enter does nothing when focus is not on the authorization card,” while coexisting with the official handler: within the panel, the original logic still applies; outside the panel, it clicks approve on your behalf. Current version 0.1.0, with 0 repository stars.

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

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

Xiaoye