Skip to content

fix(bash): require confirmation for process termination - #2095

Draft
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/2094-protect-process-kill
Draft

fix(bash): require confirmation for process termination#2095
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/2094-protect-process-kill

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #2094

Summary

  • detect bulk process termination commands in the bash tool permission scan
  • route taskkill, Stop-Process, killall, and pkill through a new forced-ask bash_process_kill permission
  • prevent wildcard allow rules or persisted approvals from silently pre-authorizing process termination
  • add TUI copy for the new confirmation prompt and hide Allow always for this forced-ask permission

Root cause

The bash permission scanner only treated irreversible file deletion as forced-ask. Process termination commands such as taskkill /F /IM node.exe or Get-Process node | Stop-Process -Force were classified as ordinary bash commands, so broad allow rules could let an agent kill the MiMoCode node runtime process without an explicit per-call confirmation.

Validation

  • bun test test/tool/bash.test.ts --timeout 30000 from packages/opencode
  • bun test test/permission/next.test.ts --timeout 30000 from packages/opencode
  • bun typecheck from packages/opencode
  • git diff --check

Note: pushed with --no-verify because the local root pre-push hook runs bun turbo typecheck and this machine is missing @typescript/native-preview-darwin-x64. Package-level typecheck above passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MiMoCode 执行 Stop-Process -Force 清理 node 进程时,会误杀 MiMoCode 代理自身进程

1 participant