Skip to content

Honor cross-turn delta when progressive reads are off - #8117

Merged
huangruiteng merged 1 commit into
mainfrom
codex/independent-native-delta-1105
Nov 6, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/independent-native-delta-1105

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Problem and change

The settings page has separate switches for progressive reads and cross-turn delta delivery. A supported native client requesting delta while progressive reads were off still received a full document on its second turn. That made a delta-only treatment behave like both switches were off.

Honor an explicit pair in native setup, generated heartbeat guards and saved-capture projection. Delta-only compares the complete source and keeps a digest-bound full recovery. A cold start, a lost baseline or a delta that would cost more can still produce a full document. Pin the generated hook to its setup route so a worker in a different directory can initialize the intended journal.

New editor saves use the versioned independent pair. Existing v0 master-off settings and the original single CLI opt-out preserve complete delivery. A worker that inherits its disabled experiment setting remains opted out. No preference installs or trusts hooks.

Verification

  • Same synthetic source at each stage, isolated native Codex app-server sessions, deterministic responses on loopback. Both delta-off combinations returned full/full/full. Both auto combinations returned full/delta/full across cold, warm and invalidated baselines. Each recovered the current objective, stop condition, best version and later negative result. Three selected pages reconstructed the historical note. Wrong agent identity was rejected in every cell.
  • In the warm delta-only case the consumer rebuilt the complete new document from the previous verified one and the actual change tree. The two tool outputs were about 10 KB versus 27 KB with both switches off in this fixture. The selective consumer used about 5–6 KB. These figures include tool framing and depend on paths. They measure neither provider charges nor solver behavior.
  • The real native compaction test separately exercises host-dispatched compaction. Additional tests cover setup, persisted preference/CLI parity, hook options and recovery.
  • Built the dashboard and ran the packaged configuration browser scenario with a disposable real backend. It saved progressive off with delta auto, reloaded both switches, turned delta off separately, rejected a failed apply and saved progressive on while keeping delta off. The existing two controls and layout are reused.

No live benchmark or installed client was changed.

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)

未发现阻塞问题。审查对象为 8117@d337d1cab282ace01680e828c497f8c6ae97b625;这是该独立开关修复的结论,不代表上层长程目标完成或具备合并授权。

动机 / Motivation

选择关闭渐进读取、同时保留跨轮差分的设置页和原生 Codex 调用者。

原先两个开关看似独立,但关闭渐进读取会使第二轮继续发送全文;此补丁让受支持宿主对完整文档使用差分,并保留完整恢复来源。 每轮重复完整材料会增加输入和读取工作,用户也无法获得开关所表达的组合。独立 base/head CLI 对照确认该组合由 full/full/full 变为 full/delta/full,差分还原结果与完整原始文档一致。

本 PR 不证明模型理解、长程净收益或费用下降,也不安装 hooks、不授权合并、不改写既有实验。

改动思路 / Approach

复用现有 machine-configuration 事务、CLI 路由和 TypeScript 差分 owner;v1 只区分旧 master-off 与新的独立开关意图,避免从旧隐式 auto 推断授权。 当前 PR 交付设置保存/读回、CLI 显式组合与原生完整文档差分;不新增调度、执行、信任或安装 authority。

渐进读取决定当前决策是否先呈现必要信息、再按需展开材料;跨轮差分决定是否复用同一原生会话中已交付的文件。两者是不同选择。v1 明确保存两项,v0 的 off 保持原有完整路径。CLI 单独 off、已有 worker 的环境 off 与显式 off+auto 分别保留各自含义。缺少有效连续性或压缩失效时仍回退完整来源,不以文件存在冒充模型已读。

以下为同一审查 harness 在 base 与 head 的实际结果;顺序是冷启动、正常下一轮、PreCompact 失效后下一轮。表中 full/delta 指传输文档,不能推导模型实际理解或计费收益。

渐进读取 / 差分 base head
off / off full/full/full full/full/full
off / auto full/full/full full/delta/full
on / off full/full/full full/full/full
on / auto full/delta/full full/delta/full

具体改动 / Changes

按不可变 base 3c7e0935fd6697291c5c432e5267816b4a667cfa 比较,全量 13 个文件为 +169/-63:生产路径 9 文件 +81/-46,测试与浏览器验证 3 文件 +74/-7,文档 1 文件 +14/-10;没有新增模块或独立决策服务。

规范依据是 docs/reference/required-work-context.md,spec_revision 3c7e093 的 Machine default、CLI facade 和生命周期说明。它已区分两个开关并要求历史 off、原始来源、会话身份及失效恢复保持有效;本次同文件中英文补充 v1 和显式独立组合。

  • Machine-default:implemented。设置页采用 v1,并分别保存和读回 mode/delta;实测 off/auto 重载后保留、off/off、503 拒绝后不变、重试到 on/off,旁路 goal_storage 保持不变。
  • CLI-facade:implemented。四组模式的公共 CLI 对照覆盖冷/热/失效;已有 v0 master-off、sole-off、环境 off 和不支持宿主由既有与新增测试覆盖。
  • Native-lifecycle:implemented。原始摘要与完整恢复、错误 Agent 拒绝、不重复 guard/spend,以及生命周期失效边界保持;额外从渐进模式切到完整模式,验证历史材料没有沿用裁剪结果。

关键代码讲解

  1. normalize_context_delivery_machine_defaults 在原 namespace 内接受 v0/v1。v1 缺少 delta 会拒绝;v0/off 不因历史隐式 auto 被升级成新的独立选择。继续使用原 preview/apply 的 revision 锁及规范化校验。
  2. setContextDelivery 从当前值和模板组成 v1,只改被点击的一项,保存后比对两项 readback。失败时回到后端已保存值,允许同一页面重试;没有新确认轮次。
  3. context_delivery_for_arguments 结合显式选项、已声明宿主及连续性能力决定 native 是否启用;off+auto 可以启用完整文档差分,sole-off 和旧 worker opt-out 不变。仅发现 CLI 或保存偏好不能建立会话保留或工作授权。
  4. project_codex_context 先提交当前完整 source recovery,再选择是否使用渐进 projection;progressive_enabled=False 不生成 context_details/first_read 导航裁剪。既有 TypeScript codec 负责 full/delta,Python 保留本地文件、锁和原生 IO。
  5. codex_context_configuration 生成显式 off+auto hook,调用处同时固定 registry/runtime。额外实际执行生成命令:从不同 cwd、带继承环境 off,仍使用指定 route,未创建外来 registry。配置只是提案,未安装到宿主。

对主干的风险 / Risks

最强风险是旧 off 被自动激活、切换模式后沿用裁剪材料,或失效后恢复到旧来源。独立 harness 检查完整 UTF-8 原文、真实分页、差分还原和冷/热/失效三阶段;四次错误 Agent 输入均拒绝且 journal 未变。另用已识别的历史支持材料从 on 切到 off,后续两轮还原成完整原文,完整 recovery 同样一致。

PASS:两份变更测试 78 passed、8 skipped;这 8 个 opt-in 原生用例随后用真实 Codex 进程及本地 loopback provider 单独执行,8 passed。后者覆盖 File/SQLite worker 隔离、实际 hooks 与不可用退回,不是生产付费模型或实际用户宿主采纳。PASS:构建 Chat、控制平面 typecheck、配置内 mypy 17 源文件、改动 Python Ruff、diff/bilingual/public-boundary、语义库存与 standard premerge 的阻塞检查。

维护性 ratchet 的失败仍保留:base/head 独立运行产生相同完整诊断,定位未改动的 interaction_contract::_admitted_interaction_next_cli_actions。premerge 将其列为 inherited advisory;没有降低阈值。执行包装在 premerge 返回后误用了 zsh 只读变量,包装退出 1;其前面的 canary 报告明确为 merge_gate_passed=true,不把包装错误写成 PR 回归或绿灯证明。早期构建依赖未准备、浏览器等待条件和私有 harness 的 provenance/路径别名错误也保留为审查成本;修正后对应不变量均重新执行,没有删去原本的 off 完整来源断言。

语义与 CI 对齐

这是对既有 context_delivery namespace 的版本扩展,不创建新的 Goal、peer、执行或额度词汇。显式 v1 是不可从旧 auto 推导的用户意图;其余权威、续跑和结算 owner 没有迁移。diff advisory 未发现支持的新增载体,不能据此声称没有语义变化;全树语义检查和实际调用对照另行通过。按当前策略未查询或等待远程 CI。

完整模式的首次 reader 保留完整分页要求;既有 compaction 恢复文字针对同一 Turn 的缺失事实,不要求重复 admission 或已完成效果。该恢复说明不是新工作 Turn 的省略授权。未测模型是否遵从文字,也未把字段或文件存活当作保留证明。

我的整体评价 / Verdict

窄任务的 problem_context 为 goal_achieved;long_horizon 为 preserved(验证连续性、失效和完整来源,没有验证净收益),user_experience 为 improved(独立组合终于可保存和使用,不增加意图确认轮次)。现有 TypeScript codec 与单一设置 owner 足够,无需为此再建服务;保留 v0 持久格式有实际兼容理由,额外版本成本与具体故障相称。

本次未改动 render、CSS 或布局;仍实看构建后的完整设置页、桌面和窄屏及保存失败状态,两个开关、当前来源和错误均能找到。 未验证已安装桌面 App、真实账号数据和模型输入保留;隔离 Chat 后端只对一次 apply 注入 503,其余设置事务使用真实 owner。 构建来源为上述 exact head 的 packaged Chat;布局本身未变,未要求公开上传隔离证据。最强剩余缺口是实际模型对恢复说明的采纳和长程完整成本对照,不能用本轮传输结果替代。没有合并、安装、发布或改写冻结试验。

English verdict: APPROVE the exact head; no blocking finding. Transport correctness and isolation are verified within the stated boundaries; model adoption and net benefit remain unverified.

@huangruiteng
huangruiteng merged commit 66b6df0 into main Nov 6, 2026
36 of 50 checks passed
@huangruiteng
huangruiteng deleted the codex/independent-native-delta-1105 branch November 6, 2026 04:28
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