Skip to content

Keep oversized diagnostics out of private chat backlog reads - #8639

Merged
huangruiteng merged 1 commit into
mainfrom
codex/compact-bot-recovery-readback
Nov 12, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/compact-bot-recovery-readback

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Opening Lark Connections can fail when an older private-chat Turn retains a diagnostic larger than the typed request limit. The original request may still be pending even after its failure notice was delivered.

Keep the original request and response evidence for the existing pending-work rule. Pass only the identity, lifecycle, and result fields from the related Session and Turn. The projection still respects source Stop and closed Session state and does not admit or replay work.

The real HTTP regression fails on the previous backend and returns the original pending count on this head. The same isolated journal kept all pending and recovery counts while transferring about 47% fewer observation bytes. 32 targeted tests and standard premerge passed.

Packaged settings readback

Both sides use the same packaged frontend and a synthetic connection on real SQLite and Chat HTTP. Only the backend revision changes. The synthetic fixture has no live Lark credentials or message consumer.

View Before After
Desktop Desktop baseline with the original connection unavailable Desktop candidate retaining the original pending request
Narrow Narrow baseline with the original connection unavailable Narrow candidate retaining the original pending request

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent marked this pull request as ready for review November 12, 2026 03:57

@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.

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

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

本次评审对应提交 a777437594732539cae6975681d8f0b21c74d60b。

无阻塞发现。旧私聊的大诊断不再让连接列表失效;真实 HTTP 和同一份打包前端均读回原待处理 1。

动机 / Motivation

打开设置里 Lark Connections 的 owner。私聊收到模型额度失败提示后,原请求仍待处理。一个旧 Turn 带长诊断时,整个连接读取可能超出 8 MiB Core 请求上限,页面无法显示原连接。候选只投影待处理判断需要的 Session 和 Turn 字段。相同 8,640,000 字节诊断下返回 HTTP 200、待处理 1;原诊断、请求、回复以及 provider 调用保持原样。验证本地文件 journal、真实 TypeScript Effect 与 Chat HTTP,Lark 和模型为合成夹具。未验证实际账户、已安装服务或其它字段超限。

改动思路 / Approach

只读 IPC 应传递原 TypeScript 判定所需的事实;无需扩大字节上限或改动状态机。继续由现有 Session/Turn、typed pending 和 source control owner 负责。 只缩小发给已有 TypeScript pending 判定的 Session/Turn 观察;不缩短持久诊断,也不另写 pending 规则。 适配 原判定

具体改动 / Changes

关键代码讲解

  • _quota_pending_inputs 留下 Session 身份/状态、Turn 与 client 身份、typed error 和完整结构化 response。原始请求继续给既有 owner 用于相关性校验。 输入
  • 单条和批量都继续调用同一个 TypeScript 判定,再按原来源 Stop 复核。response 中的 gate、未完成工作和回执仍可参与,关闭的原 Session 不会被计为待处理。 批量与 Stop

以 base b7c9178 的 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md 为准。pending_original 保留原请求;stop_and_close 保留原 scope;observation_only 不新增执行。 私聊观察与继续边界 原失败通知

对主干的风险 / Risks

在隔离真实 HTTP 上,原合成诊断为 8,640,000 B。base 发送的观察是 8,642,620 B,触发字节拒绝且 HTTP 断开;head 观察是 957 B,返回 200、待处理 1。关闭原 Session 读回 0。两版原 journal 和 provider 调用未被这些读取改变。

语义与 CI 对齐

20 项关联用例通过,覆盖源 Stop、额度失败和结构化 gate。快速 premerge 与打包来源校验通过。两个 viewport 使用同一份打包前端接各自实际后端;未查询托管 CI。

我的整体评价 / Verdict

代码评审通过。保留已有请求、回执和状态机;当前无需扩大上限或新建投影 owner。同一打包前端分别连原版和候选,桌面与窄屏原先显示连接不可用,候选首屏可见原连接和待处理 1。未运行真实 Lark、模型、安装后的账户或继续原会话操作。

English verdict: APPROVE. At a777437, the real backlog read retains one pending original despite an oversized stored diagnostic, preserves Stop and Close behavior, and shows the result on the unchanged packaged frontend.

@huangruiteng
huangruiteng merged commit a1e4384 into main Nov 12, 2026
35 of 67 checks passed
@huangruiteng
huangruiteng deleted the codex/compact-bot-recovery-readback branch November 12, 2026 04:46
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.

2 participants