Repository navigation
修复:隔离私有 Git Bash 执行器,恢复 route B 的 bash 工具注册 - #20
Merged
KannaKuron merged 2 commits intoOct 13, 2026
Merged
KannaKuron merged 2 commits into
KannaKuron merged 2 commits into
Conversation
Use a shell-only Cordis isolation namespace, explicit get() service reads, and scoped failure cleanup. Add real Cordis lifecycle regressions, an installed-host Windows runtime preview, and Windows/Linux Node 22/24 CI without changing the official PowerShell executor or bundle patch.
Move the parent test's closing assertion before the two independent dialect cases. Preserve every assertion and all four CI matrix entries; record the initial Node 22 cancellation failure in the changelog.
KannaKuron
added a commit
that referenced
this pull request
Oct 13, 2026
8 tasks done
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
修复 v0.39.0 route B 中私有 Git Bash 执行器与官方 PowerShell
shell服务冲突,导致bash工具无法注册的问题。Closes #19
关联问题:v0.39.0 route B 回归:私有执行器未隔离 shell 服务,导致 bash 工具消失
根因
createScope(ctx)创建的是 Cordis 子插件 fiber,并不建立服务隔离命名空间。GitBashSandboxExecutor的父类链最终通过ShellExecutor调用super(ctx, 'shell'),依然注册shell服务。route B 保留了官方SandboxPwshExecutor,两者使用同一个 isolation key,因此构造阶段立即报:Git Bash 路径已解析成功时也会发生。错误发生在工具注册之前,不属于 progressive tool discovery 的展示问题。
具体修复
mountPrivateExecutor(),在ctx.isolate('shell')派生上下文中创建自有执行器 scope。shell:宿主的subprocess、sandbox、sandboxPolicy等依赖继续继承。plugin(GitBashSandboxExecutor)挂载真实类,保留 Config/volatile/static inject 与 Cordis 生命周期语义。get('shell')读取活跃执行器,用get('tools')检查工具就绪;不依赖未声明的属性访问注入。没有修改 bundle patch、官方 PowerShell 执行器、shell 执行/沙箱/后台协议、工具参数/输出、preset 组合或版本下限;没有版本号变更或发布工作流变更。
回归测试与 CI
新增 5 项使用真实 Cordis Context/Service 的生命周期回归,覆盖:
同时修正两处既有测试结构问题,保持原断言:
/bin/bash。新增只读权限的非发布
ci工作流,覆盖 Windows/Linux × Node 22/24;每项运行锁定依赖安装、完整测试和包文件 dry-run。对修复分支 push 和 PR 触发,不使用pull_request_target。验证结果
npm test:127/127 通过。npm pack --dry-run --ignore-scripts、JavaScript 语法、workflow YAML 和git diff --check:通过。command -v bash、uname -s和 sentinel,退出码 0。Get-Process;默认隐藏时,bash 仍可调用。preview 使用真实宿主服务和真实 Windows 进程,policy/session/working-directory 接线为夹具;覆盖 danger-full-access。它是无头运行时验证,完整 GUI、预设选择器、PTY、后台任务和受限模式不在本次测试覆盖范围内。复验入口及范围见
tests/README.md。检查清单
2026-10-13 后续全面审查与修复
原服务隔离问题已由 PR #20 合并解决,并随 v0.39.1 发布;本记录保持已完成状态。 新一轮确认的功能/逻辑回归由独立的 后续 PR #22 承载,不属于原 PR 的已合并内容。
后续提交:
6b26ded,基于当前上游521be01,完整保留 v0.39.1 的私有服务隔离与 #21 glob real-array 修复,不更改已发布版本号。确认并修复 16 项既有问题:
保留根官方 PowerShell、route B 纯新增 patch、成功 FastCtx 全文回显、Windows 明示 unconfined 取舍,以及 autoTerminalShell OFF 只停止未来写入的独立语义。无新增依赖、功能、兼容下限调整、发布或安装动作。
本次实际验证
真实 Windows 进程验证 Git Bash
uname/sentinel 与原官方 PowerShell,新增真实 Core API 回归同时含内存 subprocess、延迟注册和受控 MCP 传输。UI/并发连接使用确定性夹具;不等同于完整 Electron GUI、生产 PresetTree、真 MCP exe 并发或受限模式端到端验收。详细触发链、修复与分层覆盖见 PR #22。