fix(codex): 远端 compact 密文失败走同一任务换窗 - #3529
Open
dashhuang wants to merge 1 commit into
Open
Conversation
订阅会话 remote compact 撞 invalid_encrypted_content 时,原样重试必败, 且 HTTP 静默剥推理密文够不到这条路径。把它当成官方 compact 确定性失败, 复用现有 host-controlled rollover:同一条任务交接重建并重放用户消息, 不再要求用户开新任务或 Fork。单独的 invalid_encrypted_content 仍留给 静默剥密文,避免供应商切换被误换窗。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/agents/shared/remote-compact-encrypted-error.ts | 新增窄范围双条件分类器,避免将单独的密文错误误判为换窗条件。 |
| packages/maker-core/src/agents/codex/translator.ts | 将 error notification 中的 message 与 additionalDetails 联合分类,并复用稳定的 context-overflow reason。 |
| packages/maker-core/src/agents/codex/index.ts | 在权威的 turn.completed 失败路径中同步标记远端 compact 密文错误。 |
| apps/desktop/src/main/maker-ipc/contextOverflowRollover.ts | 将新错误类型接入现有 rollover 检测,同时保留远程会话和副作用相关安全边界。 |
| apps/desktop/src/main/maker-ipc/tests/contextOverflowRollover.test.ts | 覆盖即时恢复、下次发送前重建及单独密文错误不触发换窗的行为。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Codex 远端 compact] --> B{错误文本同时包含<br/>remote compact 与<br/>invalid_encrypted_content?}
B -->|否| C[保留原错误处理]
B -->|是| D[标记 context-overflow]
D --> E{本地会话且可安全重放?}
E -->|否| F[Fail closed]
E -->|是| G[关闭旧 native thread]
G --> H[写入上下文交接]
H --> I[重放当前用户消息]
Reviews (1): Last reviewed commit: "fix(codex): 远端 compact 密文失败走同一任务换窗" | Re-trigger Greptile
Contributor
|
@dashhuang 👋 这个 PR 目前与 请在本地 merge 最新的 |
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.
这次改了什么
摘要
Codex 订阅会话做远端压缩时,如果历史里有解不开的
encrypted_content,上游直接 400:Error running remote compact task+invalid_encrypted_content。这条失败原样重试必败;HTTP 静默剥推理密文也够不到 compact / WebSocket。用户只能开新任务或手动 Fork。本 PR 把它当成官方 compact 的确定性失败,接到现有同一任务换窗(host-controlled rollover):关掉旧 native thread、写交接、重放刚才那句用户消息。新任务不用用户去开,也不走 Fork 并剥离。单独的
invalid_encrypted_content(供应商切换时 HTTP 还能剥推理密文)不会被误判成换窗。设计上接着 #3510 的「官方压不动就同一任务换窗」,但不改 #3510,独立合入。
变更类型
fix缺陷修复feat新功能refactor/perf重构或性能优化docs/test/chore文档与工程维护范围
invalid_encrypted_content,新任务正常。isRemoteCompactEncryptedContentError:必须同时命中remote compact与invalid_encrypted_contentcontext-overflowreasoncontextOverflowRollover把这类错误当成可重建prepareUnhealthySessionUI 变化
contextRebuild分隔样式与chat.errorBanner.contextOverflow文案。怎么验证的
自动验证
pnpm test:unit:related因改了 maker-core 公共导出而拉了全量 desktop。其中 maker-core related 通过。desktop 全量有环境性失败(claudeOrphanReaper、portReclaim、usageHistory、以及若干ioregcollect 失败),与本 diff 无关;#3510 也曾在干净 main 上复现同类基线项。CI 全量pnpm test:unit为准。手工验证
未在安装版 Cindy 上用真实 GPT-5.6 Sol 旧任务复现换窗。分类与 rollover 由单测覆盖用户截图中的文案形态。
未执行的验证
真机:打开已报
Error running remote compact task的旧 Codex 任务,发下一条,确认同一任务交接并继续。device-link / SSH 未手测(SSH 本就拒绝本地换窗)。风险
风险分类
context-overflow换窗;交接会丢掉 native 历史细节,只保留摘要。本轮已有工具副作用时不自动 replay。影响与回滚
提交前检查
git commit -s,见 DCO)