dshbase

Plugin directory / Developer / dsh-exit-bash

dsh-exit-bash

Unverified 12362566

✓ Actively maintained

View on GitHub ↗ ← Back to plugin directory

1Stars
0Forks
0Open issues
Language
2026-08-16Last push
Cross-platformPlatform

What it does

A plugin in the Developer category for DeepSeek Harness.

Our take
Unverified — not yet verified

A plugin in the Developer category for DeepSeek Harness. Not yet verified — install and test it yourself.

“Unverified” means our automated CI has not yet installed this plugin. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

Plugin author? Get the “Verified” label — submit your own evidence (screenshots, logs, or a short demo) and we'll review and flip the badge.

Submit verification evidence ↗

README

dsh-exit-bash

一个「退出 Bash」按钮 + /exit-bash 命令,用来解决:会话里已经跑过持久 bash 后无法切换沙箱模式cannot change sandbox mode ... while persistent terminal sessions are open or being created)。

原理

  • 持久 bash 工具(dsh-tool-bash-persistent)的 PTY shell 在任务结束后仍存活;
  • dsh-terminal-bash 在每次 sandbox/mode 事件提交前检查该 agent 是否还有活的 PTY(hasOwnerActivity),有就拒绝切换;
  • 本插件的宿主半边注册 /exit-bash 命令:先给 shell 发 exit(宽限 graceMs 毫秒),再 terminals.kill 移除 PTY 记录,并中止仍在创建中的 spawn;
  • 浏览器半边在会话头(agent preset 标签旁)放一个按钮,点击直接通过 remote.commands.execute 执行 /exit-bash(不经过 commandUi,避免 commandUi 内部拿不到 remote.commands 导致按钮无效)。命令结果以流程节点显示在对话里。

安装

dsh plugin --profile web add /path/to/dsh-exit-bash
# 重启 profile 使新的 bundle 层与客户端插件清单生效:
dsh web   # 重新启动你的 web profile

客户端插件清单(dsh.client 扫描)在启动时缓存,必须重启进程;宿主命令本身在 cordis 层支持热重载,但一次重启即可两者兼得。

使用

  1. 任务跑完后,点击会话头部的 退出 Bash 按钮(或在输入框执行 /exit-bash);
  2. 看到「已关闭 N 个持久终端」的流程节点后,再用输入框的权限选择器切换沙箱模式即可成功。

已知行为

  • 会话没有持久终端(如 standard preset 的一次性 bash)时,命令返回「无需关闭」。
  • 关闭后 agent 下一次调用 bash 会重新创建一个终端,且新终端按切换后的沙箱模式隔离运行——这正是期望行为。
  • 若在 agent 正在执行 bash 命令时点击按钮,正在进行的工具调用会被终止(等同用户强制关闭终端)。

配套补丁(重要)

dsh-tool-bash-persistent 会缓存每个 agent 的 PTY id;外部用 /exit-bash 直接 terminals.kill 后,工具缓存仍指向旧 id,下一次 bash 调用会先报一次 unknown PTY session ... 再自愈。为了让「退出 Bash」后下一次调用直接成功,需要给 @deepseek-ai/dsh-tool-bash-persistent 打上本包附带的补丁:

# 在 web profile 目录执行(请先确保该目录可写)
cd ~/.dsh/profiles/web
cp /path/to/dsh-exit-bash/patches/@deepseek-ai__dsh-tool-bash-persistent.patch patches/

然后在 pnpm-workspace.yamlpatchedDependencies 中加入:

patchedDependencies:
  '@deepseek-ai/dsh-tool-bash-persistent': patches/@deepseek-ai__dsh-tool-bash-persistent.patch

再执行:

pnpm install
dsh web

补丁会让 persistentShells.get() 在复用缓存的 PTY id 前先确认该 id 仍存在于 terminals 注册表;已被 /exit-bash 关闭时自动丢弃旧缓存并创建新终端,不再把 unknown PTY session 暴露给模型。

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install dsh-exit-bash for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:12362566/dsh-exit-bash

Headless (CLI) profile:

dsh plugin --profile headless add github:12362566/dsh-exit-bash

Test report

Not yet L3-verified — see failure note below if we already ran it.

Status: pending · last test 2026-08-26
Note: 验证: runtime-fail Browse all pending failures →
Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Developer

Browse all 7795 plugins →