Skip to content

fix(context): recover saved captures without unrelated registry discovery - #7601

Merged
loopx-agent merged 2 commits into
mainfrom
codex/independent-context-recovery
Oct 28, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/independent-context-recovery

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Generated quota context-read commands could fail during registry discovery when both default runtime roots contained state, even with an explicit capture/hash or native-session location. Recovery was blocked before the existing reader could validate its saved source.

Reuse the existing explicit-source exemption for both CLI registry discovery and machine-option composition. Explicit reads reach the unchanged digest, argument and native-session/Goal/Agent checks; implicit source discovery, admission and spending retain their route checks. One predicate serves the two existing IO callers; no new authority or configuration is introduced. The bilingual reader contract documents this boundary.

Validation at final head 666324562c7407fa1d0af0971b738f45eaff7ff4, rebased onto main 89a8efb44fa768e144de7d588be7befb7cc4340d:

  • Both original commits have an unchanged patch range after rebase; all four proposal files are byte-identical to the preceding head 486a82b5. DCO sign-offs are preserved.
  • 212 passed, 5 skipped across real capture recovery, literal/selected readers, machine configuration and native lifecycle tests. Skips are the existing opt-in native Codex binary cases. The 7 regression cases cover both entrypoints, invalid captures, wrong Goal/Agent/session and unchanged authority-route refusal; both default runtime trees remain unchanged.
  • Standard premerge passes: 4 direct checks, changed Python compilation and 14 selected checks, with no manual holds. Ruff and the bilingual diff check pass. No budget changes are included in this PR.
  • Original sensitivity evidence remains 4 failures / 3 passes on base 8983636, 7 passes on the source fix. Earlier expanded validation was 284 passed / 8 skipped at 8434a333, before the final test-only strengthening; it is retained as historical evidence, not substituted for the new-head run.

Historical failures are preserved: the original local base/head both emitted 25,836 > 25,500 characters. At the old head, the Linux kernel job and Windows job also failed the same ceiling, with their own base/head observations of 25,828/25,828 and 25,975/25,975. Main has since adopted the separately reviewed 26,500-character calibration; the rebased local gate passes without relabeling those old failures. The old release build job passed wheel construction, clean installation and sdist rebuild, then timed out after 30 seconds at research-display-language.mjs:146. That timeout remains causally unattributed. No manual CI rerun or CI wait was requested.

This qualifies the source CLI recovery fix. The preceding head's independent approval does not approve this new commit: the designated reviewer must confirm the exact rebased head. Integration/merge follows #7600's existing order and current readiness. Installed-host adoption and long-horizon efficiency gains remain unqualified.

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

APPROVE — 当前精确 head 486a82b5ae5b8f73832b091a1e34e2be69d09bb2 未发现阻塞代码问题。这里批准的是显式上下文恢复的路由修复;标准 premerge 仍有一项已独立归因的既有预算失败,不将它报为通过。

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported.

动机

持有已保存 capture 引用、需要继续原工作回合的 CLI Agent,以及使用原生会话位置恢复输入的 Host。

同机新旧默认 runtime 都有状态时,旧 CLI 在读取明确指定的 capture 之前先报目录冲突;本 head 让显式恢复直接到达原 reader,仍校验摘要、Goal、Agent 和 session。

两个真实 CLI 入口均可在默认目录冲突时完成显式原文及详情恢复,业务准入和记账仍拒绝冲突路由。

本 PR 不选择或修复默认目录,不迁移 Goal,不扩大执行权限,也不交付完整 C1/C2 或证明模型收益。

这是真实可观察的中断恢复问题。Agent 已经有精确来源及读取授权,最短路径是执行已有 recovery command;要求它先选择目录、重新输入信息或再问本人,都不能改善该读取的正确性。当前修复没有增加这些步骤,也不会以“可恢复”替代完整内容实际到达的证明。

改动思路

将已有显式来源判断归于同一 helper,并在共用 CLI registry 解析处提前使用;reader 的完整性与会话约束仍由原 owner 执行。

只修复显式恢复被无关默认目录发现提前阻断的调用顺序;隐式查找和所有业务命令保留原路由。

输入 旧路径 本 head 的路径与结果
显式 capture/hash 或 native location 默认目录冲突先阻断读取 跳过无关发现,原 reader 校验后读取
参数缺一半、错 SHA、错 Goal/Agent/session 可能先遇到无关冲突 原 reader 明确拒绝,不返回假空内容
隐式读取、should-run/spend 携带 capture flags 原路由校验 仍原路由校验,冲突仍拒绝

表格来自 486a82b5ae5b8f73832b091a1e34e2be69d09bb2 的源码调用关系;执行证据另列。这里没有新增状态库、reader、scheduler 或授权 owner。已有 predicate 的归并是本次合适的同域简化;进一步语言迁移没有当前需要。

独立验收依据为 docs/reference/required-work-context.md,spec_ref:https://github.com/loopx-project/loopx/blob/898363635d4737f84b6a673a9a11265a121b6f57/docs/reference/required-work-context.md,spec_revision:`898363635d4737f84b6a673a9a11265a121b6f57`。采用原文真实章节名 Machine default 与 Selected capture details / 按需读取捕获详情:恢复页不激活机器设置;显式来源仍校验原 SHA、精确值和 session;详情不能成为完整 baseline。新增双语文档是对这条既有边界的澄清,不拿改后的文档倒推验收。

具体改动

完整 diff 为4文件 +126/-3:2个产品文件 +21/-3,双语指南 +10,测试 +95。没有生成日志、迁移器或兼容层。关键代码讲解:

独立验证使用同一个冻结 oracle,产品代码分别来自不可变 base 和该 head:base 4失败/3通过,head 7通过。四个旧失败均是默认根冲突提前发生;通过项不是放松拒绝,而是显式原文/详情/native 读取成功,同时 wrong SHA、partial args、错 Goal/Agent/session 和业务 capture-flag 逃逸继续被拒。两默认目录和原 capture 的快照保持不变。

另跑 reader、selection、machine configuration、context-delivery CLI 与 argument diagnostics:235通过、5可选 native 场景跳过。官方同输入差分覆盖 96/96 观察,结构/语义/规模比较均无变化;这不冒充逐字 wire equality 或模型采用。

对主干的风险

最强回归风险是共用 resolver 的早返回范围过宽。我额外核了相反方向:should-run 和 spend-slot 即使携带 capture flags,也继续拒绝默认目录冲突;显式 native 位置仍拒绝错 Goal/Agent/session。没有把只读可达性扩展成业务权限,也没有从 EOF 推断模型保留。

标准 premerge:6 direct通过;14 selected中13通过、1失败;0 manual holds。失败是 quota_should_run/multi_agent/json emitted 25836 chars; baseline ceiling is 25500。在不可变 898363635d4737f84b6a673a9a11265a121b6f57 上运行同一原始 budget smoke,得到相同 failing identity、数值和25500阈值;当前 head 的普通 quota 输出路径与预算 owner 未变,96项完整对照也保持25836字符。故按当前 review policy 将其归为 pre_existing_unrelated:代码可批准,premerge 的红色门单独保留,不能借此修改预算或声称 merge-ready。远端 CI 未查询、轮询或等待。

我的整体评价

本次解决了一个完整、可回滚的现有 CLI 恢复问题,所需实现与问题相称。它保留了原 authority、source、分页和错误 owner,也没有把恢复工作转嫁成新的用户准备流程。没有当前需发布的 actionable finding;仍需单独处理既有预算失败及维护者合并资格。

视觉适用性:未改变渲染页面、布局或控件;已检查两个 CLI entrypoint 和现有 machine configuration 路径。

未验证范围:正式安装、真实模型保留与完整 C1/C2 效果/成本未验证;本 PR 没有视觉变更。

真实模型理解/保留、安装采用及整轮成本收益不由这些测试认证;也不据此关闭完整 C1/C2。

English verdict: APPROVE. Reviewed 486a82b5ae5b8f73832b091a1e34e2be69d09bb2; the independently attributed pre-existing output-budget failure remains a separate merge hold.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/independent-context-recovery branch from 486a82b to 6663245 Compare October 28, 2026 19:14

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

APPROVE — 在新base重新资格后,当前精确 head 666324562c7407fa1d0af0971b738f45eaff7ff4 未发现阻塞代码问题。这里批准的是新 base 上重新核验的显式上下文恢复修复;当前标准 premerge 全部通过,旧预算失败按原版本保留,旧批准没有自动沿用。

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported.

动机

持有已保存 capture 引用、需要继续原工作回合的 CLI Agent,以及使用原生会话位置恢复输入的 Host。

同机新旧默认 runtime 都有状态时,旧 CLI 在读取明确指定的 capture 之前先报目录冲突;本 head 让显式恢复直接到达原 reader,仍校验摘要、Goal、Agent 和 session。

两个真实 CLI 入口均可在默认目录冲突时完成显式原文及详情恢复,业务准入和记账仍拒绝冲突路由。

本 PR 不选择或修复默认目录,不迁移 Goal,不扩大执行权限,也不交付完整 C1/C2 或证明模型收益。

这是真实可观察的中断恢复问题。Agent 已经有精确来源及读取授权,最短路径是执行已有 recovery command;要求它先选择目录、重新输入信息或再问本人,都不能改善该读取的正确性。当前修复没有增加这些步骤,也不会以“可恢复”替代完整内容实际到达的证明。

改动思路

将已有显式来源判断归于同一 helper,并在共用 CLI registry 解析处提前使用;reader 的完整性与会话约束仍由原 owner 执行。

只修复显式恢复被无关默认目录发现提前阻断的调用顺序;隐式查找和所有业务命令保留原路由。

输入 旧路径 本 head 的路径与结果
显式 capture/hash 或 native location 默认目录冲突先阻断读取 跳过无关发现,原 reader 校验后读取
参数缺一半、错 SHA、错 Goal/Agent/session 可能先遇到无关冲突 原 reader 明确拒绝,不返回假空内容
隐式读取、should-run/spend 携带 capture flags 原路由校验 仍原路由校验,冲突仍拒绝

表格来自 666324562c7407fa1d0af0971b738f45eaff7ff4 的源码调用关系;执行证据另列。这里没有新增状态库、reader、scheduler 或授权 owner。已有 predicate 的归并是本次合适的同域简化;进一步语言迁移没有当前需要。

独立验收依据为 docs/reference/required-work-context.md,spec_ref:https://github.com/loopx-project/loopx/blob/89a8efb44fa768e144de7d588be7befb7cc4340d/docs/reference/required-work-context.md,spec_revision:`89a8efb44fa768e144de7d588be7befb7cc4340d`。采用原文真实章节名 Machine default 与 Selected capture details / 按需读取捕获详情:恢复页不激活机器设置;显式来源仍校验原 SHA、精确值和 session;详情不能成为完整 baseline。新增双语文档是对这条既有边界的澄清,不拿改后的文档倒推验收。

具体改动

完整 diff 为4文件 +126/-3:2个产品文件 +21/-3,双语指南 +10,测试 +95。没有生成日志、迁移器或兼容层。关键代码讲解:

独立验证使用同一个冻结 oracle,产品代码分别来自不可变 base 和该 head:base 4失败/3通过,head 7通过。四个旧失败均是默认根冲突提前发生;通过项不是放松拒绝,而是显式原文/详情/native 读取成功,同时 wrong SHA、partial args、错 Goal/Agent/session 和业务 capture-flag 逃逸继续被拒。两默认目录和原 capture 的快照保持不变。

另跑 reader、selection、machine configuration、context-delivery CLI 与 argument diagnostics:235通过、5可选 native 场景跳过。官方同输入差分覆盖 96/96 观察,结构/语义/规模比较均无变化;这不冒充逐字 wire equality 或模型采用。

本次重基到 89a8efb44fa768e144de7d588be7befb7cc4340d 后重新判断完整4文件提案,而不是只追加一个新SHA。独立range-diff确认两patch严格相等,4个当前文件blob与原486完全相同;accepted reader/machine文档在两base也保持原内容。共享settlement新增request身份不改变此显式读取的来源/权限范围;原reader仍不做准入、记账或live Goal查询。当前新head再跑 7个冻结恢复/权限用例、235通过/5可选native跳过,以及 96/96新base/head对照无变化;标准预检也以新base单独运行。旧898的4fail/3pass用于说明原问题,保留其版本,当前source/backend组合另有上述新执行证据。

对主干的风险

最强回归风险是共用 resolver 的早返回范围过宽。我额外核了相反方向:should-run 和 spend-slot 即使携带 capture flags,也继续拒绝默认目录冲突;显式 native 位置仍拒绝错 Goal/Agent/session。没有把只读可达性扩展成业务权限,也没有从 EOF 推断模型保留。

当前标准 premerge:6 direct+14 selected全部通过,0失败、0manual holds。旧486头与不可变 898363635d4737f84b6a673a9a11265a121b6f57 上的同条件失败 quota_should_run/multi_agent/json emitted 25836 chars; baseline ceiling is 25500 仍保留。新target 89a8efb44fa768e144de7d588be7befb7cc4340d 已由另一个合并提交采用26500校准,本PR没有调整预算;新base/head同输入仍均25836字符、Markdown均6439字符,官方96对照没有漂移。因此当前通过是明确的base变化,不声称此路由修复压缩了输出,也不擦除旧失败。未查询、轮询或等待远端CI。

我的整体评价

本次解决了一个完整、可回滚的现有 CLI 恢复问题,所需实现与问题相称。它保留了原 authority、source、分页和错误 owner,也没有把恢复工作转嫁成新的用户准备流程。没有当前需发布的 actionable finding;旧预算失败保留历史来源;实际合并仍需当前readiness和维护者权限。

视觉适用性:未改变渲染页面、布局或控件;已检查两个 CLI entrypoint 和现有 machine configuration 路径。

未验证范围:正式安装、真实模型保留与完整 C1/C2 效果/成本未验证;本 PR 没有视觉变更。

真实模型理解/保留、安装采用及整轮成本收益不由这些测试认证;也不据此关闭完整 C1/C2。

English verdict: APPROVE. Reviewed 666324562c7407fa1d0af0971b738f45eaff7ff4; the old output-budget failure is retained historically; current local premerge passes after the separately merged base calibration.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Exact-head merge validation for 666324562c7407fa1d0af0971b738f45eaff7ff4 after #7600:

  • The designated independent review approves this exact head; native approval closeout is clear.
  • Main 9f42f0bc5025c59d4bf67ae9dbef559d1f4b4231 plus this unchanged head merges without conflict. The isolated combined source passes 264 tests, with 10 existing opt-in native Codex cases skipped. Coverage includes saved/progressive recovery, explicit capture and native-location reads, and continued route refusal for admission/accounting.
  • Standard premerge at the exact author head, against current origin/main, passes all 6 direct checks and 14 selected checks with 0 manual holds. The RFC bilingual diff check also passes separately.

The existing predicate remains the shared owner of this narrow read-only exemption. Capture integrity, session/Goal/Agent scope and business authority checks remain with their existing owners. Historical budget failures and the unattributed browser timeout stay recorded in the PR body. Remote CI was neither queried nor awaited. Installed-host adoption and complete C1/C2 outcome/cost qualification remain open.

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