Preface

In DSH (DeepSeek Harness) engineering practice, tool calls typically use the timeoutMs parameter or the timeout_ms parameter of job_output to control the wait time. These parameters are filled in by the model. If the model does not specify them or sets a value that is too large, the deployment side usually lacks fine-grained fallback mechanisms, which can lead to prolonged blocking or resource consumption.

Plugin Overview

dsh-limit-timeout is a security and management plugin maintained by azazo1. It is used to intercept and check the wait duration before a single DSH agent tool call is executed.

The plugin intervenes at the tools/pre-execute stage and covers the wait parameters that are controllable by the model. When a call request exceeds the configured limit, the plugin rejects that call, records logs, and provides three alternative options for the model to consider (reduce the wait time, switch to background execution, or request an escalation).

Installation and Enablement

Before installation, make sure the DSH engine version meets the requirements: @deepseek-ai/dsh-* must be greater than or equal to 0.2.0-rc.1 and less than 0.3.0.

For Web-side installation, specify the web profile:

dsh plugin --profile web add azazo1/dsh-limit-timeout

After installation, restart dsh web to refresh the page.

Desktop-side installation does not support direct installation via the command line (the CLI rejects the --profile desktop parameter). You need to enter the package name azazo1/dsh-limit-timeout in the in-app plugin manager to install it, then restart the desktop application.

Configuration

The settings entry is located at Settings > Wait Limits. This page uses draft-style editing: changes do not take effect immediately, so you must click “Save” or “Discard Changes”.

The save operation is an atomic write. If there is a configuration conflict (for example, the default limit is higher than the hard ceiling), the save will be rejected.

The settings include the following fields:

Field Default Description
Global default wait limit (defaultLimitMs) 120000 The maximum wait time that a single call may declare. Covers timeoutMs and timeout_ms
Hard ceiling (hardLimitMs) 1800000 Even if an escalation is approved, the actual wait time will not exceed this value. Lowering it revokes previously approved escalations
Allow the model to request escalation (allowEscalation) On When enabled, the model can request escalation via request_wait_extension, which is approved by the deployment side
Require explicit wait duration (requireExplicitJobWaitMs) Off When enabled, a job_output with wait: true must also provide timeout_ms
Suppress repeat-call reminders (suppressRepeatToolReminders) Off When enabled, reminders injected by repeat-tool-reminder no longer enter the model request

Supported time formats include: 120000 (milliseconds), 500ms, 90s, 2m, and 1h. If the value is not edited, both saving and discarding changes restore it to an appropriate unit format.

Runtime Behavior

  • Interception and rejection: The plugin intercepts calls at the tools/pre-execute stage. If the call is allowed, it continues into downstream policy checks (permissions, sandbox). If the limit is exceeded, the plugin short-circuits the call into an error result, and the call is not actually executed.
  • Rejection logs: Each rejection is recorded in the Host log at the info level, including the tool name, call ID, current limit, and escalation status.
  • Escalation mechanism: Escalation requests go through the DSH native approval channel. Once approved, the escalation is only effective for the current session within the current process. Escalations are not written to the session log, so they cannot be replayed and are not retained across processes.
  • Repeat reminders: Messages injected by repeat-tool-reminder are filtered via agent/pre-step. This feature only changes what the model sees; it does not affect the session log or historical playback. The number of filtered entries is recorded in the debug log.

Use Cases and Boundaries

  • Boundary checks: This plugin only covers the wait parameters that are controllable by the model (timeoutMs and timeout_ms). The tool’s own deployment timeouts (such as fetchTimeoutMs for web_fetch) are not constrained by this plugin.
  • job_output behavior: When job_output only sets wait: true without specifying timeout_ms, the wait duration is determined by waitTimeoutMs in dsh-tool-jobs. Under the default configuration, this is not constrained by this plugin. If strict limiting is required, enable “Require explicit wait duration”.
  • Security notice: The plugin runs with the current DSH process permissions. Before installation, it is recommended to review the source code and the license (MIT).

Development

The plugin is developed in TypeScript. The source code is located in the src/ directory, and the build artifacts are located in the lib/ directory.

Common development commands are as follows:

just install
just typecheck
just build
just test
just verify

Conclusion

This plugin provides a way to control tool-call latency on the deployment side for the DSH ecosystem. By configuring global limits and a hard ceiling, and combining them with the model escalation request mechanism, it can help ensure system stability while giving the model flexible execution space.