Skip to content

Reuse unchanged Todo notes in native quota reads - #8415

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/reuse-observed-todo-note-20261109
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/reuse-observed-todo-note-20261109

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

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.

Criterion Disposition Evidence
Reuse only fully observed text from the same scoped source implemented The existing observation journal compares the exact note with its current Task, source route and revision. Title lookup and note reuse share the verified Todo source resolver.
Recover the complete current note when the source changes or context is lost implemented File and SQLite CLI test reads the corrected note and restores the original capture after PostCompact.
Complete C1 caller cutover and quantify actual model outcomes and costs deferred Continue in #8266 against the original single-session quota baseline.

Scope And Continuation

This slice stands on main independently 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 from main.

Validation

  • Tested f6047d904d0431189c47c9c7800444c72c9e2aee against 71190b6b4ef4e146f3bf4a10d31ce61ac42fd021. Also built the local C1 candidate d4dcb7374db579f8426efc4c6e2d63895468e801 against fedf8fc6d1736acad747296608bae857eba8d10a.
  • Run state finished. Input classes synthetic, public_fixture.
Check kind Result Evidence
static passed Typecheck on both branches, scoped Ruff, semantic vocabulary advisory and public boundary scan.
integration passed Focused source tests. 331 passed on the main candidate and 164 on the local C1 candidate.
integration passed Full main TypeScript control-plane suite. 6,294 passed, 78 skipped.
real_entrypoint passed Exact wheels ran the actual quota CLI, native reader and observation hooks on macOS. Both File and SQLite replayed two admissions, each with one spend, the same independent result, wrong binding rejection and same capture recovery.
regression_parity passed The repository test exercises initial delivery, observed warm reuse, exact task body, PostCompact recovery and a corrected note on both backends. The baseline replay repeats the full note.
integration passed CLI output budget base/head differential and standard local premerge command checks. The author quality receipt was verified against the same base and head.
Exact packaged pair Warm selected body Warm reader calls
main, File 54,930 → 33,949 bytes 6 → 5
main, SQLite 55,010 → 34,029 bytes 7 → 5
C1, File 54,761 → 33,780 bytes 6 → 5
C1, SQLite 54,833 → 33,852 bytes 6 → 5

All 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

  • Performance improvement
  • Test update

LoopX Area

  • Control plane

Boundary Checklist

  • Public-safe change and synthetic evidence.
  • Scope limited to the observed selected Todo note and its existing source resolver.
  • No paired RFC or UI files changed.
  • Commit signed off.

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

This branch has not been deployed

No deployments
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