Repository navigation
Reuse unchanged Todo notes in native quota reads - #8415
loopx-agent wants to merge 1 commit into
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
没有阻塞性发现。 最大待验证项是已安装宿主的模型保留、实际 token 成本和长程结果。
动机 / Motivation
使用 Codex App 连续处理同一个 Todo 时,用户希望助手能沿用已经收到的备注,并在备注更正或上下文丢失时重新收到全文。
基线每次首次读取都重复发送长备注。候选确认本会话此前完整收到同一段正文后,把该备注改为引用,并在同一次读取保留当前任务、权限及结算信息。
在真实 File 和 SQLite quota CLI 上,两边的同轮备注都能从完整捕获读回。已有完整观察时,候选的选中正文少 20,981 字节,读取页数由五页减到三页。 此次仅修改原生渐进读取。现有 #8266 继续验证 C1 的调用方切换、安装态和长程成本。
剩余是 #8266 的统一调用方切换和已安装宿主的长期效果验证。
改动思路 / Approach
候选复用已存在的逐字段观察日志。首次读取先核对当前 Goal、Agent、Todo 查询和来源,备注更新后会重新交付。匹配时复用的是 note,当前任务、权限和结算仍可读。仅从输出中删除长备注会让未读和恢复分支缺少任务背景。现有读日志能证明这一字段已交付,足以在相同来源重用。
同一已验证的 Todo 应继续提供任务和备注的权威来源。复用既有观察日志只省去重复的备注正文,当前任务和结算必须随本轮交付。 保留现有 quota 和 context-read owner,把当前变化限在选中备注的首读引用和共享 Todo 来源校验。
具体改动 / Changes
评审提交 f6047d904d0431189c47c9c7800444c72c9e2aee 对照 main 的 71190b6b4ef4e146f3bf4a10d31ce61ac42fd021,本地与 GitHub 的 4 路径改动一致。基线规范为 docs/reference/required-work-context.md。 基线规范 C1 的剩余验收见固定版本的统一执行合同.
observed-current-note已验证。同一合成 note 在完整观察后才复用。lossless-recovery-and-off已验证。保存但未观察、PostCompact、校正、显式 off 都返回当前全文。current-task-and-receipt已验证。当前 Task 及每轮原收据一致,实际结算不重放。C1-model-and-cost留给 #8266,沿已有单会话 quota baseline 验证。
关键代码讲解
verifiedSelectedTodoSource核对完整且唯一的当前 Todo 来源,共用原标题和备注的筛选条件。源码reusableFirstReadFields仅在 ready、原 provider 权威读回和原记录仍有效时把 note 加入可复用字段,当前 provider revision 仍可读。源码observedFirstRead比较当前正文摘要与已有完整工具观察,保留同次完整捕获。源码currentTaskTitleOwner检查当前选中 Todo 与 lane 一致,仍由原 Task 内容决定标题引用。源码
对主干的风险 / Risks
同一合成备注,File 43,710 → 22,729 字节、SQLite 43,736 → 22,755 字节,两边 5 → 3 页;原 Task 字符串和当前 Turn 回执准确。 只读文件且未记录完整工具交付、PostCompact、正文更正都会交付完整当前备注。 显式 --context-delivery off 直接得到原完整备注、任务和当前 Guard 回执;两个后端与基线一致。 复现依次交付并结算前三轮,四轮各读到一份 guard 回执。首次 off 探针在前一轮尚未结算时两边均未准入,按原合同结算后,两边 off 验证通过。独立源码套件候选 248 项通过,快速预合并 5 项直接和 3 项所选检查通过。CI 未查询。
语义与 CI 对齐
新增的是现有观察字段的一项,未增加共享状态、执行资格或隐式调度规则。初次或当前来源正文不一致时,用同一 captured reader 读完整 note。
我的整体评价 / Verdict
多轮复用保留了任务、原收据与恢复。独立结果仅证明传输缩减,尚未证明模型净收益。 相同用户操作获得相同任务与当前权限;失去观察时自动恢复全文。 独立验证使用合成备注和 hook 事件,运行真实本机 CLI、Node、File 与 SQLite。实际 Codex 模型留存、延迟、token 费用和 C1 效果还需实测。
English verdict: APPROVE at f6047d9. Observed note reuse preserves the current Task, recovery, explicit off and original receipts.
Goal And Delivered Outcome
A ready quota guard repeats the complete selected Todo note on every native first read, even after the reader recorded the same note in the current Codex session. The first read now reuses an unchanged note only after a fresh, verified read of the same Todo and authority route. Current task text, authority and settlement remain in the read. The immutable capture still serves the complete note.
Related to Controller RFC C1 and #8266. Target
main.Author Declaration
Written by model_agent, OpenAI GPT-6 (Codex). Implemented against the C1 requirement to preserve applicable source facts and original Turn identity through native reads and recovery.
Scope And Continuation
This slice stands on
mainindependently of C1 and the optional RPC compression proposal in #8413. Reverting the commit restores the previous first-read selection. The same patch applied cleanly to the public C1 head and was tested locally there. After mainline adoption, C1 can take the shared implementation frommain.Validation
f6047d904d0431189c47c9c7800444c72c9e2aeeagainst71190b6b4ef4e146f3bf4a10d31ce61ac42fd021. Also built the local C1 candidated4dcb7374db579f8426efc4c6e2d63895468e801againstfedf8fc6d1736acad747296608bae857eba8d10a.finished. Input classessynthetic,public_fixture.staticpassedintegrationpassedintegrationpassedreal_entrypointpassedregression_paritypassedintegrationpassedAll four pairs saved 20,981 bytes of selected body and had equal cold and forced-recovery body sizes. The warm measurement includes the first read and its necessary supplements in a fixture with a 12,000-byte output cap. The complete comparison used a synthetic note. Actual model tokens, timing and net outcome costs remain to qualify. The public regression test reproduces the behavior. The paired measurement harness remains local.
Frontend / Visual Evidence
UI impact
none. This changes native quota read presentation.Type of Change
LoopX Area
Boundary Checklist