Skip to content

fix(chat): retain timed-out requests after failure notices - #7849

Merged
loopx-agent merged 1 commit into
mainfrom
codex/retain-timeout-backlog-20261101
Nov 1, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/retain-timeout-backlog-20261101

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

An upstream response timeout can leave a request unfinished after its failure notice has been delivered. The private conversation then loses that request from its pending count.

Retain correlated response_timeout failures in the existing Core pending projection, alongside quota failures. Explicit source stops and closed Sessions still retire the obligation. Recovery admission continues to check native effects, permissions and retry limits independently.

Validation: 50 TypeScript tests, control-plane typecheck, Ruff and two native Core/provider journeys passed. The same new cases fail on the base revision (one TypeScript and two native cases). Full affected Core/Lark regression: 354 passed. Standard premerge: 5 direct and 10 selected checks passed. Public boundary scan is clean; the aggregate local check retains two pre-existing legacy Goal authority errors.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

未发现阻断性问题。在私聊助手中查看请求进度的用户。上游超时后,失败提示送达会让待处理数归零;修改后仍保留这项未完成请求。连接状态读回与回复扫描器重建后仍显示该待处理项,原失败与已核验回执保持不变。本 PR 不修上游超时原因,不放宽自动重试,也不把待处理统计当作执行许可。

效果未知的超时仍需原恢复 owner 对账;整个异步业务闭环和实际模型完成不由本 PR 宣告完成。这个增量把既有状态入口修到可用,不能据此宣告整个异步业务闭环完成。

改动思路 / Approach

判定继续放在既有 TypeScript owner,Python 只读原始事实;派生计数与执行恢复保持分离,因此不需要第二队列或新增策略开关。本 PR 只交付已相关联超时请求的待处理保留及原停止边界,未知效果接续仍归既有恢复 owner。最强的反对理由是:增加待处理数字不能解决上游超时;但不修会持续隐藏未完成请求,而修改投递状态或另建队列会混淆既有 authority。当前修改只增加一个既有错误码分支,正好修复已证明的漏账。

原请求状态 主干 本 head
超时,失败提示已送达 错误移出待处理 继续保留,效果仍需核对
明确停止、新会话、关闭或已完成 沿既有生命周期处理 同一处理与原始记录保持

表格是状态比较说明,执行证据来自 native Core/provider 测试和同 harness 的主干反例。

具体改动 / Changes

关键代码讲解

  1. planBoundConversationRequest 在既有 pending_observation 中保留精确关联的 failed/response_timeout。只返回派生布尔值,没有创建 reservation、Turn 或模型调用;普通成功和 policy failure 沿原分支。
  2. quota_backlog_pending 保持只读 Core 相关联事实与 stop/new 事件的职责。显式停止可移除待处理,但 provider 不可用或已发失败通知不能替代业务结果。
  3. LarkPrivateConversations.health 先核对原 binding/source/Session/Turn,再把结果计入现有 pending_count。新增 native regression 真实经过 Core 入队、失败、provider 回执核验与 transport 重建,验证读回不新增执行、不改旧失败,原 /stop 与 /new 仍可撤销。

规范依据:Accepted conversation RFC,spec_revision 07b555494550c12ff6e3dc4b139cdf7cd1bdae32,本文未修改它。native-history-migration-and-unfinished-request-continuation 对应“失败通知不是完成”和提示/执行分离,已落实到上述判定与反例;explicit-unfinished-work-after-a-completed-turn 的原 partial/gate/stop 边界由既有回归保留,没有扩展其可恢复执行范围。更广的业务恢复资格仍属于既有未闭工作。

对主干的风险 / Risks

最重要的风险是把“待处理”误当“可以重试”。当前 diff 未触及恢复准入、native effects 证明、权限、次数或 backoff;测试在观察期间直接禁止 enqueue/recover,并核对原始消息、失败 Turn、模型 dispatch 与 provider writes 不变。错误 Session/Turn、closed、stop/new 和 completed/policy 分支均有否定验证。

PASS:354 项 Python、50 项 TypeScript、control-plane typecheck、Ruff,以及标准 premerge 的 5 个直接检查和 10 个选定检查。相同最终 harness 在 07b555494550c12ff6e3dc4b139cdf7cd1bdae32 上出现预期的 1 项 TS 与 2 项 native 断言失败;源文件已精确恢复。三文件公开边界扫描通过。总检仍保留独立 authority 配置错误,未记为本 PR 修复;按当前策略未查询或等待 GitHub CI。

语义与 CI 对齐

复用既有状态和 response_timeout 错误码,未引入状态库、协议版本、CLI 或新开关。diff-scoped advisory 未发现支持范围内的新载体,不能据此推导全部语义已被自动分析。合成宿主异常覆盖了 Core/回执链,不证明真实上游超时原因、后续 native effects 或模型最终完成;这些限制继续保留。

我的整体评价 / Verdict

APPROVE。long_horizon 为 preserved:持久请求、单执行者及恢复门未变;user_experience 为 improved:已有状态入口不再漏掉这类未完成请求。视觉评估为 not_applicable:只修派生值,已检查既有 private-conversation-panel 消费,页面结构、排版、折叠与响应式分支未改;本 PR 不重新评价既有页面视觉设计或跨屏体验。

Scope-fit 与 bounded refactoring 判断:现有 typed owner 已合适,无需增加模块、兼容层或抽象;本次独立可回滚的边界是超时保留,实际安装与原数据采用仍需正常升级后的独立读回。审核对象为 d93653cdc6cf991cf5d522a8de935ac13b0a36f9,任何 head 变化都需重新核验。

English verdict: APPROVE d93653c. Correlated timeout requests remain pending after verified failure notices; native execution, lifecycle and recovery fences are preserved. 354 Python tests, 50 TypeScript tests and standard premerge passed.

@loopx-agent
loopx-agent merged commit 8ac384c into main Nov 1, 2026
13 of 34 checks passed
@loopx-agent
loopx-agent deleted the codex/retain-timeout-backlog-20261101 branch November 1, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant