Repository navigation
fix: 兼容旧宿主的 Bash 注册与会话 cwd,纠正激活假阳性 - #28
Closed
KouzakiUmi wants to merge 1 commit into
Closed
KouzakiUmi wants to merge 1 commit into
KouzakiUmi wants to merge 1 commit into
Conversation
KannaKuron
added a commit
that referenced
this pull request
Oct 13, 2026
…pe (absorb PR #28's shape) Reviewing KouzakiUmi's PR #28 (an independent #27 fix opened in parallel with v0.39.3) against the shipped fix: semantics were identical, but the PR disposed the half-mounted agent scope on a registration miss instead of leaking it, and gated success on an applied+read-back pair. This absorbs the throw-and-dispose shape; the PR is closed with credit.
Owner
|
感谢这份 PR——它和 v0.39.3 是并行撞车的独立修复(你 22:54 开 PR,维护者同晚基于 #27 报告独立实现并于 00:20 发布 ba09867,review 窗口没有先对上彼此在修同一件事,这是维护侧的流程疏漏)。 对照结论:两个实现的语义完全一致——inject 最小化、 对照中你的实现有两处更优,已吸收进 main(114dcde,将随下个版本发布):
因此本 PR 关闭( |
4 of 8 tasks
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.
问题与修复结果
Fixes #27。
在没有
workingDirectory服务的 Desktop/Core 上,自有 Bash 模块把该服务声明为硬 inject,Cordis 会让 fiber 静默 INACTIVE。await fiber仍返回,包装层打印 activated,但 Bash 从未注册。执行入口也缺少旧宿主的会话 cwd 接缝。本 PR 移除该硬依赖,新增
resolveSessionCwd统一读取目录:ctx.get('workingDirectory')读取真实服务并调用官方ensure(agent, signal),保留当前目录、验证、恢复及取消语义。服务存在但验证失败时原样报错,不退回旧目录。policy.workspaceRoot ?? session.header.cwd接缝;默认目录取该值,相对workdir按它解析,绝对workdir保留。无 Agent 的调用维持原有执行器默认行为。apply()已执行并且 Bash 在实际工具面可见,才打印 activated。静默 INACTIVE/未注册明确报告 activation failed,并释放 agent scope。例如会话目录为
D:/session-project时,缺服务宿主的默认 Bash cwd 为该目录,workdir: scripts为D:/session-project/scripts;若真实服务报告E:/current-project,则仍使用后者。依赖与范围
直接补装官方 alpha.2 工作目录包不足以兼容旧宿主:该包依赖 fs/sessionProjections/systemPrompt,旧 systemPrompt 缺少
WORKING_DIRECTORY排序项,会在初始化时拒绝非有限 order。相关源码核查及隔离反证已记入 CHANGELOG。因此本修复适配执行目录读取,不安装或注册另一份 Core 工作目录服务。本 PR 独立基于上游 main,可独立评审,不依赖开放中的 兼容边界 PR或实验 native PR。实验 native 后续可复用同一目录读取适配器。官方 root PowerShell、既有沙箱行为和版本号保持不变。
验证
环境:Windows / Node 24.13.0 / 实际安装 Core 0.2.1-alpha.2。
npm test:159/159,exit0,无 skip/cancel。npm run test:preview:17/17,exit0,无 skip/cancel。npm pack --dry-run通过。preview 使用实际 ToolRuntime/Cordis/私有执行器,命令 provider 与 Jobs admission 为内存桩。旧宿主以缺服务及旧契约形状验证,尚未在 Desktop 0.2.0-rc.2 安装本体或生产 GUI 复验。 报告者的本机补丁验收证据归属原 issue,不作为本 PR 的独立真机验收。