fix(desktop): empty-response 纳入中断自动续跑的有界恢复 - #2514
Merged
MagicLizi merged 1 commit intoAug 12, 2026
Merged
Conversation
fix makecindy#2320:长会话/大上下文下模型返回退化空响应(无文本、无工具调用、 usage=0)时,translator 已把它严格识别为 reason: 'empty-response' 的终态 错误,但 Desktop 自动续跑分类器 isInterruptedTurnError 的 reason 门把它 明确排除 —— 连续空轮在恢复介入后仍停在原地等人工接手,用户只能反复手动 发「继续」。 把严格命中的 empty-response 与 upstream-overload / codex_reconnect_stalled 同列为已归类可重试 reason 放行: - 判据完全复用 translator 既有的完整条件(本轮发起过 API 调用、无可见 文本、无 result 兜底文本、无工具调用、无 compact boundary、单轮 usage 增量全为 0),不看文案、不看 UI 显示的 0 tokens。 - 接管后复用既有恢复状态机:零产出 turn 走克隆重发原文(active-turn recovery 已落库,重发安全);已有 durable progress 的长任务带 RecoveryCheckpoint 续跑,不重放已完成工作。 - 止损不变:连续 5 次失败上限、单次人工介入周期 10 次硬上限、指数退避 + jitter、kill switch;预算耗尽后横幅交还用户,不静默结束。 原「零产出无可续」的排除理由已过时:coordinator 的 auto 路径对零产出 turn 本就实现了安全的克隆重发(performRetryLastError)。 测试:reason 门新增 empty-response 放行用例(带文案 / 仅 reason 两态); turn-failed 与 silent-stop-exhausted 维持拒绝。 Signed-off-by: ficowang <fico@xd.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-ipc/interruptedTurnAutoResume.ts | 将严格分类的 empty-response 加入可恢复 reason 白名单;现有调用链会安全进入统一且有界的自动恢复流程,未发现缺陷。 |
| apps/desktop/src/main/maker-ipc/tests/interruptedTurnAutoResume.test.ts | 覆盖 empty-response 有无文案时的接受行为,并继续验证其他稳定终态 reason 不会被自动恢复。 |
Reviews (1): Last reviewed commit: "fix(desktop): empty-response 纳入中断自动续跑的有界..." | Re-trigger Greptile
MagicLizi
approved these changes
Aug 12, 2026
MagicLizi
left a comment
Contributor
There was a problem hiding this comment.
Code Review (review-pr-auto): 0 P0/P1 发现。empty-response 加入自动续跑白名单,translator 判定条件严格(apiCalls>0, zero output, zero usage),既有的连续失败上限/backoff/episode 硬限制完整保护。测试覆盖到位。
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.
这次改了什么
摘要
fix #2320。长会话/大上下文下模型返回退化空响应(无文本、无工具调用、usage=0)时,translator 已把它严格识别为
reason: 'empty-response'的终态错误,但 Desktop 自动续跑分类器isInterruptedTurnError的 reason 门把它明确排除——连续空轮在恢复介入后仍停在原地等人工接手,用户只能反复手动发「继续」。把严格命中的
empty-response与upstream-overload/codex_reconnect_stalled同列为已归类可重试 reason 放行:原「零产出无可续」的排除理由已过时:coordinator 的 auto 路径对零产出 turn 本就实现了安全的克隆重发(
performRetryLastError)。变更类型
fix缺陷修复feat新功能refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
apps/desktop/src/main/maker-ipc/interruptedTurnAutoResume.tsreason 门放行 empty-response + 对应测试UI 变化
不涉及。
怎么验证的
自动验证
手工验证
不涉及(空响应为偶发上游退化行为,无法稳定手工复现;分类器行为由测试断言)。
未执行的验证
未在真实空响应现场端到端验证,原因如上;恢复路径复用既有已验证状态机,本 PR 只放宽入口分类。
风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)