Skip to content

Commit ae557b2

Browse files
committed
fix: preserve executable lookup in isolated release validation
1 parent 536c924 commit ae557b2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

changelogs/releases/v1.20.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
- 记忆写入可根据真实宿主和唯一任务补齐会话编号及绑定,重复分配幂等;SUMMARY 支持结构化条目。
1717
- 更新后继续原任务;已发布版本、磁盘安装与当前宿主连接加载分别验证,不将安装成功宣称为已加载新运行时。
1818
- Windows 验证子进程等待父进程实际接收最终回执后再关闭通道,避免成功结果丢失而误记为中断。
19+
- 修复真实宿主安装验收的隔离环境丢失 `PATH`,并在耗时探针前检查 Codex 可执行文件及版本。
1920

2021
这些恢复行为不覆盖宿主拒绝,不猜测冲突目标,不把保存草稿或未知副作用宣称为任务完成。

scripts/test-global-install-smoke.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ function isolatedHostEnv(home) {
431431
const resolvedHome = path.resolve(home)
432432
const parsedHome = path.parse(resolvedHome)
433433
return {
434+
...process.env,
434435
DEVCODEX_TEST_HOME: home,
435436
DEVCODEX_POSTINSTALL_FORCE: '1',
436437
CI: '',
@@ -677,6 +678,10 @@ assert.strictEqual(
677678
)
678679

679680
const installedEnv = isolatedHostEnv(globalHome)
681+
// Resolve the real host using the same complete environment as direct helper calls,
682+
// before the expensive installed S15 probe starts.
683+
const realCodexExecutable = smokeOptions.realCodex ? resolveCodexExecutable(null, installedEnv) : null
684+
const realCodexVersion = smokeOptions.realCodex ? readCodexVersion(realCodexExecutable, installedEnv) : null
680685
runCommand(binPath, ['init', '--profile', 'consumer'], { cwd: workspace, env: installedEnv })
681686
assert.ok(fs.existsSync(path.join(workspace, '.devcodex')), 'workspace init must create only .devcodex runtime')
682687
assert.deepStrictEqual(
@@ -986,8 +991,6 @@ if (smokeOptions.realCodex) {
986991
'real-codex-host-probe.js'
987992
)
988993
assert.strictEqual(fs.existsSync(installedRealHostHelper), true, 'installed real-host helper is missing')
989-
const realCodexExecutable = resolveCodexExecutable(null, installedEnv)
990-
const realCodexVersion = readCodexVersion(realCodexExecutable, installedEnv)
991994
realHostIdentity = createRunIdentity({
992995
mode: 'installed',
993996
sourceCandidate: smokeOptions.sourceCandidate,

0 commit comments

Comments
 (0)