dsh-approval-policy

Introduction

DeepSeek Harness (DSH) plugin. It solves the problem where unattended approval requests (subagent, scheduled, cron) can hang indefinitely. In dsh >= 0.2.0-rc.2, if an interactive answerer is registered but never responds, such requests will remain stuck. This plugin prepends a gate on the approval request waterfall: it sets a bounded response window for unattended requests. If a response is received within the window, the human’s answer is used; if the window expires, the request is resolved according to the fail-closed default outcome.

Installation

The plugin is installed via npm. Before installation, ensure the host DSH version is >= 0.2.0-rc.2.

dsh plugin add @aiwayds/dsh-approval-policy

After installation, the plugin automatically mounts at the head of the approval/request waterfall chain.

Configuration

Configuration is located in cordis.patch.yml. The mount block ID is dsh-approval-policy.

- insert:
    - id: dsh-approval-policy
      name: '@aiwayds/dsh-approval-policy'
      config:
        origins: [subagent, scheduled, cron]
        windowSeconds: 60
        defaultOutcome: rejected

Configuration Options:

  • origins: List of origins identified as unattended. Supports subagent, scheduled, cron, all. Defaults to [subagent, scheduled].
  • sessions: Sessions selected by agent id glob. If matched, all turns of that session are gated. Defaults to an empty array.
  • windowSeconds: Response window duration in seconds. 0 means immediate rejection without delegating downstream. Defaults to 60.
  • defaultOutcome: Default verdict after the window expires. Only supports rejected or unavailable. Defaults to rejected.

Behavior and Limitations

  • Determination Granularity:
    • subagent: Determined at the session level (session.header.origin === 'subagent').
    • scheduled / cron: Determined based on the source.kind of the last traceable user message (skipping synthetically injected messages such as runtime-context).
    • all: Global gating.
  • Interactive Sessions: For interactive sessions that do not match any origin, the plugin passes through immediately without any modification, preserving the default behavior.
  • Zero Overhead: The plugin does not write additional audit logs or state files. It relies on the host’s approval/asked and approval/decided logs.
  • Verdict Limitations: defaultOutcome does not support allowed-once. On timeout, the request must be resolved as rejected or unavailable.

Uninstallation

dsh plugin remove @aiwayds/dsh-approval-policy

After uninstallation, approval behavior reverts to the host’s native state, with no window restrictions.

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

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

Xiaoye