Skip to content

Reuse delivery health metadata when opening Lark settings - #8801

Merged
loopx-agent merged 1 commit into
mainfrom
codex/steward-settings-metadata-20261115
Nov 15, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/steward-settings-metadata-20261115

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Opening Lark connection settings on a long-running installation repeatedly parsed delivered-message journals and called the native queue selector for idle sessions. The full settings read could time out even while the same connection grants were available.

Reuse the receipt correlation and feedback metadata while each delivered journal is unchanged. Pending deliveries and changed journals still use their current records. An ordinary queue read with no queued candidates can return an empty list after inspecting storage. This keeps the original delivery counts, unfinished work, and revoked binding recovery visible.

On the same isolated history, two warm settings reads took 26.1–26.3 seconds before the change and 3.0–5.6 seconds after it. All sampled reads matched on bindings, pending and recovery counts, and Stop results. The first load and timing on other hosts still need qualification. The changes include the module's exact line-count entry in the maintainability ledger.

Validation covered 13 focused tests, including concurrent Session close, changes written directly to the original Turn, atomic replacement or removal of a journal, and queued work for a revoked binding. The two focused performance regressions failed on the original code and passed with the fix.

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)

评审提交 e680fda8ab5941d845f498555b32b497a93cd4ba,目标基线 af92301ab4cc67d209e64c115eb6694e3c74ceb7。

没有发现阻塞本次热读优化的缺陷。冷读与尚未覆盖的条件见下文。

动机 / Motivation

受影响的是打开飞书连接设置、查看待投递消息及撤权后是否仍有任务在停止的用户。 同一个连接留在页面上时,客户端每五秒重查一次。过去每次都把已经投递的大段回复再解析一遍,还要给没有待办的会话查询队列;现在重复读取复用未变记录的小段元数据。 隔离验证中,重复打开与自动刷新时返回相同设置状态,做的重复工作更少;记录更新和停止结果仍能在下一次读取显示。 运行了实际 Chat HTTP、File 层和 Core;提供方是合成的,未测已安装实例、Windows 原生计时或真实飞书网络。页面布局、输入、权限和送达规则未调整。 尚未资格化重启后的首次打开、实际长历史的尾延迟,以及其他主机的表现。

改动思路 / Approach

本 PR 到同一设置接口的重复读取、元数据复用和普通空队列为止。 重用 Native Chat 的文件发现器;让 Core 继续拥有当前 Turn、停止恢复和权限,缓存只影响显示的读取成本。 零排队候选的普通读取是在扫描过真文件后才提前返回;预约、显式容量和严格路径不使用这条分支。

具体改动 / Changes

  • health: 重用不可变投递记录的关联字段、阶段布尔位;不保留回复正文。 可缓存投递记录仍须有匹配的 Core 请求并重查 Turn。
  • rows: 把既有文件发现器用于设置的投递日志。 重写、删除、并发换代或无可靠变更戳时走原 reader。
  • queued_turns: 普通读取没有排队候选时就返回空;之前会对空列表也调用原选择器。 非空、strict、预约和显式容量路径都走同一个 TS owner。

以 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md 的基线版本为准,核对了 settings-current-stop-recovery:设置反复读仍保留准确的撤权停止恢复,Core 确认终止后才移除。;unrelated-authorized-work-continues:撤权只影响原绑定,其他授权工作继续。;current-source-ownership:现有绑定与投递相关性仍由 Core 验证;设置读取不运行任务。。改动 4 个文件(+53/−4);模块账本按实际增长调至 2213 行。设置保留原 GET 和相同前端刷新节奏。

对主干的风险 / Risks

同一套本地 HTTP/File 夹具(32 个 Session、512 份约 63 KB 的投递记录),双方各六次热读;中位数 214→174 ms,约少 19%,返回值一致。 在 12 个 Session 的隔离对照中,热读解析 96→0 份投递记录,队列选择调用 12→1。逐个关闭优化会分别恢复 96 次解码或 11 次空队列调用,投影不变。 保持字节数和 mtime 不变地原子替换一份记录时,下一次请求仅重读该份并看到待恢复状态;删掉后计数也跟着更新。Core 中被撤权等待停止的原 Turn 停止后,下一次读不再显示它,授权的排队 Turn 仍在,且 GET 无持久写入或提供方调用。 独立空队列测试确认 strict、预约和显式容量模式仍咨询 TS owner;空普通读即使 owner 不可用仍给空结果,非空和受保护路径继续返回相同错误。 两次独立冷启的首个请求,基线为 0.56–0.70 s,候选为 0.84–1.00 s。两边在该夹具均低于客户端 5 s 读取上限;样本不证明尾延迟。 标准 premerge:6 项直接检查,13 项自动检查,0 项失败。 此结果不复现作者报告的绝对秒数,也不把合成历史当成已安装场景。 未查询托管 CI。

我的整体评价 / Verdict

批准该提交的热读范围。页面每五秒后台复查一次,优化可以在既有流程里产生收益;冷启风险需要单独追踪。 检查的是飞书连接设置的读取、刷新和停止状态数据;页面排布、文案及控件未改,没有新的视觉评审项。

English verdict: APPROVE at e680fda for the bounded warm-read change. Matched HTTP reads retained current stop and revocation state; the sampled cold read was slower and remains separate from rollout qualification.

@loopx-agent
loopx-agent merged commit b46a76d into main Nov 15, 2026
35 of 47 checks passed
@loopx-agent
loopx-agent deleted the codex/steward-settings-metadata-20261115 branch November 15, 2026 01:17
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