Skip to content

Fix paging and numeric fidelity for saved native quota context - #8319

Open
loopx-agent wants to merge 3 commits into
mainfrom
codex/native-saved-context-regressions-20261108
Open

loopx-agent wants to merge 3 commits into
mainfrom
codex/native-saved-context-regressions-20261108

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Saved native quota context has two regressions. The saved reader rejects a valid explicit page window. A normal Todo selection can also turn the source value 1.0 into 1 by running a no-op replan projection through JSON. Native continuity then falls back to the full capture.

Accept explicit native page windows through the existing reader validation. Skip replan presentation for ordinary decisions and apply typed edits to the original source values when a saved replan actually needs presentation. The selection uses the existing capture and admission rules.

The review reproduced a third issue on both main and the first proposal. The ordinary turn plan fixture exceeded its growth limit. State the current Vision packet requirement once and preserve the full writeback instructions. Previous review

Related to #8259 and #8273. The target main revision is 8a4d4f9dab17b01d6fe3546936155b4d718fc20d.

Author Declaration

  • Written by: model_agent, GPT-6, OpenAI (Codex)

Implemented against

Required work context at the target revision.

Criterion Disposition Path Verification
An explicit native page window bounds the attached UTF-8 page and its cursor implemented loopx/cli_commands/quota_capture.py Read the first page, then continue and replay the selected field after compaction. Reject invalid and stateless overrides.
Exact source identity distinguishes integers, integral floats and signed zero implemented loopx/control_plane/quota/turn_envelope.ts Compare original and presented quota values. Preserve integral floats, signed zero and a large integer through a staged replan.
A verified predecessor can produce a delta, and invalidated continuity recovers the full capture implemented loopx/cli_commands/quota_presentation.py File and SQLite same-turn selection with warm, compacted and feature-off cases. Real Codex App Server and benchmark worker calls with loopback inference.
Autonomous Vision authoring fits the existing plan budget implemented loopx/control_plane/goals/vision_checkpoint.ts Matched CLI fixtures and actual File/SQLite Vision readback. The full current packet, canonical status/history, deliberate edits, fresh path, retained fields and original Turn recovery remain explicit.

Scope And Continuation

The page validation also appears in the release integration. #8273 retains ownership of release qualification. The older quota replan-view reader has a separate number-preservation gap in the previous review. Installed adoption, model comprehension and cost remain unverified.

Validation

  • Tested revision: bc9074b3a7bf7e480d05e97ecc891839bab9bb8e
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence
regression_parity passed Four targeted cases fail on the target revision and pass on the proposed head. Both explicit native windows and both warm File/SQLite selections are covered.
real_entrypoint passed tests/control_plane/test_saved_context_project.py and tests/control_plane/test_replan_staged_read.py: 108 tests. The native subprocesses use Codex CLI and a loopback fixture.
real_backend passed Isolated File and SQLite 3.53.4 exercise native quota selection and recovery.
unit passed 70 TypeScript Vision and Turn envelope tests.
output_budget passed Paired growth 11,432 to 11,364 characters under the existing 11,400 limit. The base/head differential passed with 98 matched CLI measurements per arm. Small and multi-Agent Turn plan lengths are unchanged.
vision_readback passed 66 CLI budget and Vision tests, with one temp-layout test skipped. Both backends preserve the old complete packet when following the readback instructions. An invalid durable change still fails before writing.
static passed Control-plane type checking and quick premerge against the target revision.

The earlier independent approval applies to the previous commit. Fresh review is pending for the updated head.

Frontend / Visual Evidence

  • UI impact: none
  • First viewport and preview: N/A
  • Source data: none

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Host or runtime integration

Technical Direction

Core control plane hardening. Saved capture fidelity and native recovery.

Shared-authority RFC fixture impact

N/A. Presentation repair.

Boundary Checklist

  • Public-safe sources and verification summaries.
  • Scoped to saved context and the reproduced Turn plan budget failure.
  • No paired RFC changed.
  • UI impact is none.
  • All three commits include DCO sign-off.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 92b39554354775484effdbbe33ea3156b6ec9882)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit a56f1962af5017e759df0fc0b641345503ad109a)

@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

已经保存准入结果的 checkpoint worker 会用有限的工具输出读回上下文,再在同一个 Turn 选择 Todo。它需要保留原数值和按窗口续读。 用同一已保存决策运行原生首读与选择,并在 File 和 SQLite 比较热态以及压缩后的返回。 显式窗口可随游标续读。两种存储的正常选择恢复了热态差分,压缩后可从当前完整文件恢复原值。 评审涵盖六条变更路径和真实 Codex CLI 的隔离回环。数值修复也覆盖共享展示入口中的真实 replan。 本次覆盖原生 saved-context 的入口和恢复。旧 replan-view 的数值输出与 Turn plan 增长是两项已复现的现有问题。实际部署、模型采用和成本未在此验证。

改动思路 / Approach

先验证原 capture 的身份和窗口,按原 reader 投递。保存选择后,普通路径保留同一 payload,有 replan 路径则应用 typed 编辑。现有完整或差分选择继续依据可验证的文件前驱。 普通入口跳过一次空投影,真实 replan 仍由原 TypeScript owner 决定展示,Python 只应用现有编辑协议。窗口参数交给相同的 UTF-8 reader。这一范围足以修复当前消费者两条路径。 仅修复原生分页和已保存入口展示,不扩大准入、写回或任何新能力。

具体改动 / Changes

基线为 8a4d4f9dab17b01d6fe3546936155b4d718fc20d。原生首读规范要求整个响应遵守字节预算并从同一 capture 续读。数值与来源身份、前驱失效回退另有独立约束。 基线规范

  • 显式页窗。 同一组 CLI 用例在主干有三项分页失败。目标提交接受显式内容窗口,并按实际序列化 UTF-8 字节、偏移和 EOF 复核附带页与续页。显式选读经 PreCompact 后继续,回放仍得到同一份内容。
  • 原始值和不同来源。 独立的 replan 样本中,当前入口保留 1.0、-0.0 和 9007199254740993。值确实相同的两份验收仍共用读回。只有数值类型或精度不同的两份在当前入口各自保留,基线把它们折叠。
  • 差分及失效回退。 File 和 SQLite 的原 guard 与选中后的原始捕获都写出 1.0。基线投递变成 1,两种后端都走 full。目标提交保留 1.0,热态使用绑定原捕获的 delta。PreCompact 后改走当前 full,仍读回 1.0。
  • 同轮边界。 无效窗口、非原生显式覆盖和身份或摘要不匹配均拒绝。压缩后的续读和回放保留原捕获与 journal,两个后端的选择对照均为一次原 guard 加一次同轮选择、零扣额。关闭投递仍得到原 should-run 结果。

关键代码讲解

原普通已捕获路径也把 payload 整体送进 JavaScript 做空投影,JSON 返回会把 1.0 变成 1。修正后普通路径沿用原值,只有真实 replan 请求现有 TS owner 返回编辑。分页沿用当前 reader 的同一窗口验证。 页窗入口 · 普通捕获分支 · Python 编辑应用 · TS replan dispatch

对主干的风险 / Risks

原生生命周期、明确关闭及错误窗口都跑过。共享展示入口的真实 replan 在关闭原生投递时也使用原始数值。原准入和选择回执独立读回,实际选读不引入新的扣额。旧读端的数值归一化和 Turn plan 预算单列。 数值来源规范 差分回退规范

108 项入口测试与 83 项 TypeScript 测试通过,控制面 typecheck 通过。匹配子集从主干的 5 失败、5 通过变为 10 通过。 Quick premerge 的 6 项直接检查和 3 项选中检查通过。 合并树和两个提交的 DCO trailer 已核验。 独立的旧 quota replan-view 读端在两个 revision 都把示例值输出为 [1,0,9007199254740992]。原 SHA 绑定的 context-read 在两边均返回 [1.0,-0.0,9007199254740993]。 Turn plan 增长检查在两边都观察到 11,432 字符,超过 9,300 + 60 × 35 = 11,400 的现有门槛。 远端 CI 未取样。

语义与 CI 对齐

变更沿用现有窗口、数字表示和摘要身份规则。已启用的实际入口覆盖指定字节、压缩续读、原数值及热态前驱。现有 Turn plan 增长门保留。

我的整体评价 / Verdict

同意此提交的 saved-context 修复。实际入口同时验证了受限续读、同轮数值保真和 full/delta 两条路径。现有 Turn plan 标准检查仍是独立合并门。 本次覆盖原生 saved-context 的入口和恢复。旧 replan-view 的数值输出与 Turn plan 增长是两项已复现的现有问题。实际部署、模型采用和成本未在此验证。

English verdict: APPROVE. At 5f1a5ff, explicit paging resumes through compaction, and File/SQLite retain 1.0 with a warm delta and a full fallback after invalidation. The existing Turn plan growth check still fails on main and this head.

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

阅读拥挤 replan 计划并准备 Vision 写回的 Agent 需要在同一 Turn 保留完整现有意图。 比较同一实际 CLI 的小型与拥挤计划,逐条复核自动重规划写回指令和已发布的原捕获验证。 同一小/拥挤夹具下,main 和旧头均增长 11,432 字符;当前增长 11,364,低于未改的 11,400 上限。小计划仍为 10,553,拥挤计划从 21,985 降至 21,917。 本轮增加的提交只改 autonomous Vision 文字;此前 native 页面窗口和保存 replan 数值修复仍在同一 PR,原独立证据已发布。 独立旧 quota replan-view 的数值缺口仍在原范围之外;安装采用和模型理解未评估。

改动思路 / Approach

已发布的页窗和数字保留路径延用。新增改动只影响已有自主重规划说明的呈现,不改变 ordinary authoring。 把当前包的复制、缺失读回、编辑约束分别直接写出;精简重复语句,不修改 typed schema、校验、字段、门槛或恢复入口。 本轮增加的提交只改 autonomous Vision 文字;此前 native 页面窗口和保存 replan 数值修复仍在同一 PR,原独立证据已发布。

具体改动 / Changes

基线为 8a4d4f9dab17b01d6fe3546936155b4d718fc20d。Required work context 及既有 Vision 协议保留完整工作指令、原写回身份和明确恢复边界。 基线规范

  • 原窗口与数字。 此前两提交未改;原独立核对。现有 170 项入口套件重新通过。
  • 增长门。 同一小/拥挤夹具下,main 和旧头均增长 11,432 字符;当前增长 11,364,低于未改的 11,400 上限。小计划仍为 10,553,拥挤计划从 21,985 降至 21,917。
  • 指令条件。 保持全量替换。已有 Vision 时应从当前 Agent 的完整包及完整 vision_patch 开始,仅编辑已复核字段并给新的 path_delta;缺材料先读 canonical status/history。保留 state 及其余字段,retained 描述不会补齐漏项。原写回后的 checkpoint-context 仍只能恢复同一 Turn。

关键代码讲解

缩短说明由现有 owner 渲染;原读回和 writer与恢复协议仍决定行为。稀疏示例只表示语法,原状态和其余字段仍需带上。

对主干的风险 / Risks

体积收益集中在自主重规划。两次旧失败均用当前相同环境复现。实际模型的理解与已安装采用仍是独立问题;旧 reader 结果不阻塞此次同源入口。

当前头 170 项 Python 通过、15 项跳过;104 项 TypeScript 通过;原 CLI 增长检查复验通过。 Quick premerge 的 6 项直接检查和 3 项选中检查通过。 DCO 与合并树通过。 这次新增提交只改自主 Vision 提示。当前真实 File/SQLite writer 用例验证原摘要、settlement identity 及错误来源拒绝。 远端 CI 未取样。

我的整体评价 / Verdict

代码评审批准。新提交恢复原计划增长门,保留已发布的窗口与数值修复,以及可核验的 Vision 写回和同轮恢复义务。 独立旧 quota replan-view 的数值缺口仍在原范围之外;安装采用和模型理解未评估。

English verdict: APPROVE. Approve the new head. The same CLI fixture drops growth from 11,432 to 11,364 against the unchanged 11,400 ceiling, while the emitted Vision replacement, canonical readback and same-Turn recovery obligations remain intact.

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