You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patched main bundle now contains the cache wrapper (__opencodexWorktreeShellEnvironmentCache).
Test run: gateway/test/official-desktop-compat.test.cjs = 44/44 pass, including the new case.
Heads-up for anyone running the suite: the tests consume gateway/dist, so a plain node --test gateway/test/...
against a stale dist fails the new case until pnpm run build:gateway (i.e. pretest) has been run.
Note: unrelated to this PR, we are also tracking a chronic app-host / AppView RPC staleness problem in #53.
Environment: Linux x86_64, gateway started with pnpm run web:dev, desktop shell from the official Linux .deb.
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
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.
问题描述 (Problem Description)
在官方 Codex / ChatGPT Desktop 最新运行时版本(如
26.908.40834 (build 8881))中,main.js对"worktree-shell-environment-config"的定义由内联的async({cwd, hostId}) => { ... }重构为直接委托给实例方法:原有的
WORKTREE_SHELL_ENVIRONMENT_PATTERN正则仅匹配旧版内联async函数形式,导致:recognizedCount: 0 < markerCount: 1),在 Manifest 中被标记为"worktreeShellEnvironment": "unsupported-layout"。/api/health检查失败并显示健康状态异常(compatibility.status: "degraded",static.cache.main.worktree-shell-environment报Cached locator did not resolve)。/worktree-shell-environment-config,由于缺少限流合并与 2 秒 fallback 超时保护,耗时过长(10s~20s+),导致 Web 界面卡在启动加载(Loading)状态。修复方案 (Solution)
OfficialRuntimeOptimizer.ts中的WORKTREE_SHELL_ENVIRONMENT_PATTERN,同时兼容旧版内联async块以及新版委托给this.readWorktreeShellEnvironment的方法调用形式。this绑定,确保包装后的 cache handler 正确执行。测试验证 (Testing)
node --test gateway/test/official-desktop-compat.test.cjs相关单元测试通过。26.908.40834 / build 8881)上验证,补丁成功应用,/api/health返回ok: true,compatibility.status: "ok",Web 端正常加载。