Skip to content

fix(context): preserve active release for staged readers - #7984

Merged
huangruiteng merged 1 commit into
mainfrom
codex/context-delivery-main-20261103
Nov 3, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/context-delivery-main-20261103

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Captured context readers currently pin sys.executable -m loopx.entrypoint. For release-snapshot installs, that subprocess can lose the wrapper-owned release environment and import an older system module, so staged context reads or writeback commands reject newer subcommands even though the parent invocation is current.

This change pins generated commands to the exact active release launcher when LOOPX_RELEASE_ROOT matches the imported module root. Explicit CLI routes remain unchanged, and source or package installs without a verified release launcher retain the existing interpreter fallback.

Validation:

  • 11 passed, 1 skipped across command invocation tests and the staged-reader real-path regression
  • Ruff and git diff --check pass
  • Public-boundary scan passes for all three changed files
  • Version-skew smoke: stale system interpreter exits 73; the generated release launcher exits 0 and renders the current command help

Signed-off-by: huangruiteng <huangrt01@163.com>
@huangruiteng
huangruiteng force-pushed the codex/context-delivery-main-20261103 branch from 697ac0c to ab12775 Compare November 3, 2026 10:22

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Approval conclusion

精确 reviewed head:ab1277525029b9a54a5d70223697863987c901e8;比较基线:cbc1eeabd740ac557c3a4fb7bf67050ad063b629。当前完整范围已按 capability-owned 19项证据重新判断。

动机 / Motivation

从 release snapshot 启动 LoopX、随后执行 staged reader 或写回命令的 Agent。 父命令属于当前 release,子解释器却可导入过期系统模块;现在仅在 release root 与实际导入根相符且 launcher 可用时固定该 launcher。 独立 stale PYTHONPATH 反例的子命令在基线退出73,当前 head 返回0并给出当前 goal-acceptance help;真实 staged review→acceptance→writeback reader 路径通过。 没有新准入、扣额、任务执行、合并或安装权限;不证明模型保留、token节省、Windows或持续长程收益。 完整 staged 模块仍有与基线逐项同因的10项 fixture失败;原生 Windows、已安装机器升级及长期模型采用尚未验证。

改动思路 / Approach

现有 reader 的可独立交付修复;没有安装或模型收益资格化。

复用现有 command_invocation 单一程序选择 owner;release 的文件检查属于现有 Python 启动 IO,未引入 TypeScript 决策、存储或配置 owner。 正向链路为 staged context / acceptance reader builders → current_loopx_cli_argv → exact verified release launcher → selected child command; foreign/unavailable release → existing interpreter fallback。原捕获和摘要仍是读取依据,argv只是选择执行这条已有命令的实现;有结果输出不意味着新准入、来源保留或执行权限。当前调用/staged模块23通过/10失败/1跳过,基线21通过/同10失败/1跳过;新增两个 root 单元例及实际 changed staged regression 通过。 这是一项现有旅程的完整、有界修复,长期模型采用与完整成本属于未验证边界。

具体改动 / Changes

依据不可变规范/owner loopx/command_invocation.py@cbc1eeabd740ac557c3a4fb7bf67050ad063b629,逐项映射:current_loopx_cli_argv:implemented,显式 CLI 选择优先;默认程序属于当前实现,而不是任意环境中的 loopx。;Native context delivery:implemented,由当前实现产生的 staged、acceptance 与 writeback reader 可在新 subprocess 继续,且不重准入。。检查了所有变更路径、实际调用者和现有owner,未增加重复决策、配置或存储。普通显式选择、固定引用、原捕获恢复和关闭路径仍沿用既有约束;原始字节、必要来源及停止条件不能被导航成功替代。组合检查仅使用独立未提交源码树,重叠文档同时保留两项含义,不是安装、主干合并或运行中实验更新。

关键代码讲解

对主干的风险 / Risks

同一基线实际子解释器在 stale module 环境退出73,当前严格匹配的 release launcher 返回0;显式 CLI 优先、foreign root 与不可用 launcher 保留原回退,不接受仅靠环境变量声明的任意 root。 完整 staged/call 模块仍为 23 PASS / 10 FAIL / 1 SKIP;不可变基线是21 PASS及相同10 FAIL/1 SKIP。逐项核对两条interaction_contract、四条path、四条replan_action_packet KeyError,而非只比数量;它们仍按旧inline对象读取已存在的native reference envelope,quota/capture/codex生产owner字节未变。新增root控制和实际staged回归另行通过,因此这10项归为既有fixture失败,不宣称已修复,也不要求本PR改无关协议。

当前三项组合候选的实际路由、首读、command及staged检查为 94 PASS / 1 SKIP;16个相关TS模块为 263 PASS / 1 SKIP。该组合树不代表任一独立PR的资格,也不证明已安装产品。单项标准premerge通过,保留一项原始 FAIL 的既有maintainability advisory:完整base/head输出及formatter blob相同,magnitude_regressions=0;未把它改记为单项通过。

语义与 CI 对齐

复用现有程序选择、捕获、JSON pointer和状态owner,未新增共享词表。行为变化明确披露并通过真实调用反例校验;文档是读取/恢复义务,不能视为额外授权。未查询、轮询或等待CI,远端状态为 UNVERIFIED;CI未知不构成独立review阻塞,真实回归、必要覆盖、readiness与合并授权仍分别判断。

我的整体评价 / Verdict

当前head的可观察读取/恢复得到改善,原要求、状态及权限语义保持;long_horizon取preserved,user_experience取improved。完整 staged 模块仍有与基线逐项同因的10项 fixture失败;原生 Windows、已安装机器升级及长期模型采用尚未验证。 有界重构结论为unnecessary:单一owner的31行分支已经可单独验证与回滚,继续抽象会增加维护成本。当前没有已验证的阻塞发现;批准结论仅覆盖该head及上述证据,后续单独读取approval closeout与merge readiness,不执行合并或安装。

English verdict: APPROVE this exact head; CI was not consulted. Merge readiness and authority remain separate.

@huangruiteng
huangruiteng merged commit 9c2803f into main Nov 3, 2026
29 of 38 checks passed
@huangruiteng
huangruiteng deleted the codex/context-delivery-main-20261103 branch November 3, 2026 12:20
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