补齐 #1519 的 Hook 与显式项目保护 / Complete #1519 hook and explicit-project safeguards#1538
Draft
Yuimi-chaya wants to merge 2 commits into
Draft
补齐 #1519 的 Hook 与显式项目保护 / Complete #1519 hook and explicit-project safeguards#1538Yuimi-chaya wants to merge 2 commits into
Yuimi-chaya wants to merge 2 commits into
Conversation
Yuimi-chaya
marked this pull request as ready for review
July 16, 2026 16:19
Yuimi-chaya
marked this pull request as draft
July 17, 2026 21:47
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.
中文
这是 #1519 的追加补丁
#1519 已经修复了供应商切换后的基础状态同步,并为 Codex App 原生“无需项目开始任务”失效提供了运行时兜底。随着新版 Codex App 的入口和插件 Hook 状态发生变化,真人测试又确认了两个仍会破坏该功能契约的遗漏,建议尽快合并本追加补丁。
否则用户仍可能遇到:
hook_unavailable。例如 Windows Attention 无法注入当前任务 ID,Codex 也就无法通过 Windows 通知联系用户。根因
[data-composer-navigation-target="workspace-project"]。projectless v5 没有识别这个真实的用户意图,状态仍停留在generic,后续 dispatcher/AppServer 包装器继续删除projectAssignment并执行 projectless 清理。[desktop]、沙盒和工作区状态,但插件 Hook 的信任哈希位于config.toml的[hooks.state]。每个供应商快照因此保留了各自陈旧或缺失的 Hook 状态,切换时可能覆盖当前已经信任的 Hook。修改内容
project意图,取消延迟中的 projectless 清理,并使旧草稿上下文失效。[hooks]表视为全局 Codex App 状态,在供应商配置写入时同步到目标配置。[hooks]时移除目标快照中残留的陈旧 Hook 状态。preserve_live_app_settings,反映其职责不再局限于[desktop]。notify,避免与 Windows Computer Use guard 的通知入口冲突。auth.json、API Key、供应商 URL 等认证或供应商专属内容。兼容边界
thread/start中出现 cwd、workspace roots 或projectAssignment判断用户显式选择了项目,因为 Codex App 原生错误继承最近项目时也会生成相同形状的请求。本补丁只以真实项目选择器交互作为权威信号。验证
node --check assets/inject/renderer-inject.jscargo fmt --all -- --checkgit diff --checkcargo test -p codex-plus-core --test cdp_bridge --test relay_config --test relay_switch -j 2已在 Codex App
26.707.12708.0完成真人测试:[hooks]快照的供应商后,Windows Attention Hook 可继续正常绑定任务并发送通知。English
Follow-up patch for #1519
#1519 preserved core Codex App state across provider switches and added a runtime fallback for the native projectless New Task regression. New Codex App entry points and plugin Hook state exposed two remaining gaps during human testing. This follow-up should be merged soon because both gaps can still break the user-facing contract fixed by #1519.
Without this patch, users may still see either of the following:
hook_unavailablebecause their trust state was lost. For example, Windows Attention can no longer inject the current thread ID, so Codex cannot notify the user through Windows.Root causes
[data-composer-navigation-target="workspace-project"]. Projectless runtime v5 did not recognize this explicit user intent, so the dispatcher/AppServer wrappers continued removingprojectAssignmentand applying projectless cleanup.[desktop], sandbox, and workspace state during configuration writes, while plugin Hook trust hashes live under[hooks.state]inconfig.toml. Provider snapshots therefore retained independent stale or missing Hook state and could overwrite currently trusted Hooks during a switch.Changes
projectintent after explicit selection, cancel pending projectless cleanup, and invalidate stale draft context.[hooks]table as global Codex App state and copy it into the selected provider configuration.[hooks]table.preserve_live_app_settingsto reflect its broader responsibility.notifyownership unchanged to avoid conflicting with the Windows Computer Use guard.auth.json, API keys, provider URLs, or other provider-specific credentials.Compatibility boundaries
thread/startrequest is not proof of explicit selection because the native stale-recent-project regression produces the same request shape. This patch uses interaction with the real project chooser as the authoritative signal.Verification
node --check assets/inject/renderer-inject.jscargo fmt --all -- --checkgit diff --checkcargo test -p codex-plus-core --test cdp_bridge --test relay_config --test relay_switch -j 2Human validation passed on Codex App
26.707.12708.0:[hooks]table, Windows Attention continues binding the task and delivering notifications.