zhangzujian/dsh-same-mode-sandbox-noop

插件Plugin 原生Native ⭐ 4 MIT 安全Security

DSH 兼容插件,用于冗余的同模式沙箱升级请求

项目介绍Project Overview

DSH 兼容插件,针对 0.1.0-rc.6 版本在 sandbox_permissions 与当前沙箱模式同级时误报升级的问题。它包装 ctx.tools.execute() 和 Agent Loop 调度入口,在快照前为 bash、pwsh、write、edit 移除冗余的 sandbox_permissions 与 justification 字段。出现于 DSH 0.1.0-rc.6 因模式不严格更宽而拒绝调用的场景。属外部兼容方案,建议优先升级至共享层已修复的版本。

DSH compatibility plugin for the 0.1.0-rc.6 issue where sandbox_permissions equal to the current effective mode is wrongly rejected as an escalation. It wraps ctx.tools.execute() and the Agent Loop scheduler's preparation entry, stripping redundant sandbox_permissions and justification pairs for bash, pwsh, write, and edit before DSH snapshots arguments. Use only with DSH 0.1.0-rc.6 when non-escalating calls fail. Prefer an upstream release that fixes this in the shared sandbox escalation layer.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

npx @deepseek-ai/dsh@0.1.0-rc.6 plugin --profile web add "$PWD"

zhangzujian/dsh-same-mode-sandbox-noop 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-same-mode-sandbox-noop

A removable compatibility plugin for DeepSeek Harness / DSH 0.1.0-rc.6.

That release rejects a tool call when sandbox_permissions names a mode that is already covered by the call's effective sandbox mode:

Error: sandbox escalation to "danger-full-access" is not strictly wider than
this call's current "danger-full-access" mode

The plugin wraps both ctx.tools.execute() and the rc.6 Agent Loop scheduler's preparation entry point before DSH snapshots and freezes tool arguments. For bash, pwsh, write, and edit, it removes the paired sandbox_permissions and justification fields when the requested mode is equal to or narrower than the calling session's effective mode. The original runtime then executes the call under its standing policy. For example, a workspace-write request in a danger-full-access session is not an escalation, so the redundant pair is removed.

Genuinely wider requests, unknown modes, malformed argument pairs, unrelated tools, and calls without escalation fields pass to DSH unchanged. For a known non-escalating request, an empty justification is removed with the redundant permission fields before DSH validates it; for a genuinely wider request, the same empty justification remains subject to DSH's original validation. Disposal restores the original runtime methods.

This is an out-of-tree compatibility workaround. Prefer a DSH release that handles non-escalating requests in the shared sandbox escalation layer when one is available.

Install into a DSH profile

Until this package is published to npm, clone it and add the local directory:

git clone https://github.com/zhangzujian/dsh-same-mode-sandbox-noop.git
cd dsh-same-mode-sandbox-noop
npx @deepseek-ai/dsh@0.1.0-rc.6 plugin --profile web add "$PWD"

The package declares a DSH bundle, so dsh plugin adds its patch layer to the profile automatically. Restart dsh web after installation.

To remove it:

npx @deepseek-ai/dsh@0.1.0-rc.6 plugin --profile web remove @zhangzujian/dsh-same-mode-sandbox-noop

For a one-off local overlay without profile installation, insert the plugin by file URL in a patch loaded after the base bundle:

- insert:
    - id: same-mode-sandbox-noop
      name: file:///absolute/path/to/dsh-same-mode-sandbox-noop/index.mjs

Test

Unit tests require only Node.js:

npm test

Integration tests run against an installed DSH tree:

DSH_INSTALL_DIR=/path/to/npx/cache/package npm run test:integration

DSH_INSTALL_DIR is the directory containing node_modules/@deepseek-ai.

License

MIT

上一个 Prev dsh-timeline 下一个 Next Solarized-dsh-theme