Skip to content

fix(checkpoint): continue under an explicitly selected model and effort - #7258

Merged
huangruiteng merged 15 commits into
mainfrom
codex/checkpoint-model-transition
Oct 24, 2026
Merged

huangruiteng merged 15 commits into
mainfrom
codex/checkpoint-model-transition

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A complete checkpoint could not continue under a newly selected model: exact configuration checks rejected the receiver before inference, and research-context adoption still equated the destination profile with the source. This change adds an explicit model/effort transition for a new isolated receiver while preserving sealed source verification, complete history and current Goal/Todo authority.

完整 checkpoint 原先会因模型配置变化在调用模型前被拒绝;只改原生 fork 还会被研究上下文接续拒绝。本修复允许新隔离接收端显式选择模型及思考深度,并贯通原生会话、会话绑定、研究 Todo 接续与恢复重试。

  • Target: main, qualified against 62fb69d01131371bd9bfb75b090a2ad332a76c0e. The focused checkpoint change was transplanted onto main; unrelated staged replan/integration changes are excluded. The original proposal ancestry is retained for a normal, non-forced branch update.

Author Declaration

  • Written by: Codex agent (OpenAI GPT-6 family).
  • Specification: the requested explicit model-switch continuation described above, against the existing warm receiver contract in benchmark/README.md at the base revision.
Criterion Disposition Owner / evidence
Preserve sealed source config, cursor and history implemented native checkpoint provider; real native host fixture
Explicit model/effort change only implemented shared configuration validator; provider, sandbox and native Goal counterexamples
Carry verified destination provenance through Todo adoption and retries implemented existing session store and research checkpoint host; binding/readback and real continuation tests
Keep default restore strict and conserve execution authority implemented option-off composition, existing authority checks; no budget/opportunity code changed

Scope And Continuation

Use the exact source file with --restore-config and opt in with --restore-model-config DESTINATION_CONFIG; the target must match the runner's explicit model/effort. The host CLI exposes --destination-model-config. Only top-level model and reasoning effort may differ. Provider and authentication ownership, other settings, fixed guest paths and Host version retain their checks. The source checkpoint is never rewritten.

The existing session binding atomically retains the source and destination profile/configuration facts. Ordinary observations retain them only for the same conversation; an unrelated replacement does not inherit them. Qualified context refresh preserves provenance. Missing, ambiguous, advanced or differently configured recovery still refuses another fork.

Python remains the existing native Host transport adapter; the small profile-digest seam reuses the existing session owner rather than introducing another authority. Configuration comparison is shared by preflight and receiver admission. This is the existing CLI/Host stage; a packaged frontend restore journey and sustained benchmark benefit remain unqualified. No task scoring, cooldown, opportunity, execution budget or source checkpoint contents are changed by this PR.

Review Correction And Validation

The P2 review finding is fixed at the existing boundaries: return dict[str, str], pass explicit typed profile keywords, pass the optional transition directly, and retain a non-null binding local. No ignore or relaxed typecheck is added.

评审指出的12条新增类型诊断已修复。改动仍在原有会话与checkpoint owner内;本PR已改投main,未包含实验集成分支的其他重规划改动。

  • Declared uv run --extra test python -m mypy --no-incremental --no-pretty --show-error-codes: passed on main and the repaired proposal. Main's current import graph does not reach all checkpoint modules, so this result alone is insufficient.
  • Explicit strict check of all four shared checkpoint/session modules using the same interpreter and flags: 5,240 pre-existing diagnostics on the immutable main base and 5,240 on the repaired proposal; no added or removed diagnostic identities after normalizing line numbers only. The original integration head reproduced 5,254 under its declared command. This PR does not claim to repair unrelated typing debt.
  • Focused transition/configuration, binding/replay, native history and warm-start suites: 115 passed, 22 optional skips. Provider/auth ownership, sandbox, native Goal activation, tampered source and redirected config counterexamples are included.
  • Real codex-cli 0.163.0-alpha.11.1 with deterministic loopback provider: 2 passed, covering the explicit model/effort transition and default warm preparation, source history/context adoption, exact retry, subsequent tool work under the selected model/effort, and rejection after history advances. No paid model or benchmark run.
  • Existing CLI/session and research continuation cases: 10 passed, 1 optional skip.
  • Ruff, diff hygiene and bilingual RFC check passed. Standard diff-based premerge: direct checks, compilation, 10 catalog canaries, 8 risk-profile smokes and public-boundary scan passed. The benchmark-sensitive maintainer review hold remains separate from automated validation.
  • An initial validation command used a nonexistent test path and ran no tests; the corrected command produced the 10-pass result above.
  • Previous author/reviewer Linux, provider and wider fixture observations remain historical evidence, not new qualification at this head. Full SForge container operation, packaged frontend restore, scientific benefit and sustained cost are outside this bounded mechanical continuation qualification. No PostgreSQL change or qualification claim.
  • Merged to main by the maintainer at 2026-10-24 15:52:41 UTC as 6393ab60ecae1879534f36446f1fb700072711a1; the merged proposal head is 9772b95d5a4ec109c8bea72a2cf02b0af7a33e32.
  • History reconciliation: the retained integration ancestry caused GitHub to close refactor(replan): replace inline advice with captured review and writeback #7197 as merged too. This focused transplant does not establish delivery of its staged replan behavior: the merged tree lacks its staged-read test and the quota replan-view entry. The original checkpoint/replan owner must reconcile the actual main behavior before treating refactor(replan): replace inline advice with captured review and writeback #7197 as delivered; no duplicate merge of fix(checkpoint): continue under an explicitly selected model and effort #7258 is needed.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…first

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…t views

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…first

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…base' into codex/edgebench-integration-v24

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

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机

需要从完整 checkpoint 恢复并显式换模型的研究操作者。原先更换模型会在恢复准入或后续研究上下文接续处被拒绝;本次保留封存源配置,另传目标配置,只允许模型和思考深度变化。真实原生用例已执行换模型后的后续工具工作,并验证精确重试和历史前移拒绝;但本次新增 12 条类型诊断仍需修正。这条路径能让操作者保留已完成的研究工作后选择新的模型;不证明完整 SForge 容器运行、打包 frontend restore、模型研究质量、匹配实验收益或完整成本降低。

改动思路

复用现有原生 checkpoint、会话绑定和研究 Todo 接续 owner:源配置继续用于校验封存证据,目标配置只决定一个新接收端。只修改 fork 不够,研究上下文也必须识别同一条源/目标绑定。当前切片是已有 benchmark CLI/Host 恢复路径的完整机械接续;打包 frontend 和长期收益留在既有 S7/S11 验收,不能把这次 fixture 当成整体产品完成。这种分工与现有 owner 相符,无需另建状态库或改写通用配额规则。

入口状态 当前行为
未传新选项 保持原配置、原 profile 的严格恢复
显式目标模型/深度,其余配置不变 验证源配置后绑定新接收会话
provider、权限、原历史或恢复意图变化 拒绝接续或再次 fork

具体改动

评审绑定 7258@cda47abc9a5cf12bb1b59f8357ff9d20c04874ae;实际目标分支为 codex/edgebench-integration-v24,Git merge-base 为 0a79186d79fa218039e2d7b72bb5b4711e36bd3b,完整范围为11文件、+461/-50。规范采用原 warm receiver 合同。逐项核对:sealed-source、explicit-transition、useful-continuation 的机械路径已实现;required-typecheck 尚未满足。源码读取与当前原生用例证明接续,不沿用作者的 Linux 或完整 runner 资格。

关键代码讲解

  • checkpoint_destination_config 先核对封存源字节,再限制目标仅改顶层 model/effort;WarmStart 复用它,额外文件只进入已有私有 staging。
  • admit_native_checkpoint_session 核对源 profile、当前目标与完整历史,在既有 registry fence 内提交目标绑定;已前移或不明确的恢复结果仍拒绝第二次 fork。
  • _store_codex_cli_session 扩展同一记录的可选来源事实;相同会话观察和合格 refresh 保留,无关 replacement 不继承。
  • _context_session 将目标 profile/config 与封存源绑定后才允许研究证据接续,既有当前 Todo、lease 与原操作重试规则仍在各自 owner。

对主干的风险

[P2] 请消除本次新增的12条 strict mypy 诊断。 同一解释器、相同受控环境和真实不可变 checkout,基线为5,242条/615文件,当前为5,254条,新增12条、没有移除。具体是:checkpoint_destination_config 的裸 dict 返回类型1条;异构 **profile 两处调用8条;_bind_verified_fork 的条件字典展开2条;研究接续中可空 wake.binding.get 1条。全局已有错误不需要由本 PR 清理,但这12条来自新代码,不能归到旧基线。最小修正是精确声明事实类型、使用显式类型化关键字参数,并先保留非空 binding 局部变量;以 uv run --extra test python -m mypy 及既有 native transition/default 用例复验,避免添加 ignore 或放宽检查。

独立执行结果: focused suite 109通过、6失败、16跳过;6失败均在缺失 SForge 导入处,基线/当前的测试函数、环境及完整规范化失败签名相同,保留失败,不声称 provider 已通过。研究/session suite 57通过、1跳过;真实 Codex 2通过,确认目标请求采用 fixture-next/max 并执行后续工具,默认 warm preparation、精确重试及历史前移拒绝均通过。关闭选项时,profile 和普通/来源绑定/观察/refresh/无关 replacement 的完整结果与基线相同,无语义字段归一化。Ruff、6直接检查、10 catalog、8风险 smoke 和公开边界检查通过;benchmark-sensitive 人工门保留。未查询或等待 CI。

我的整体评价

REQUEST_CHANGES。这是有实际后续工作证据的合理增量:长期工作恢复能力与操作者显式选择都有机械改善,完整研究收益、成本和打包 frontend 尚未证明。现有 owner 复用和默认关闭隔离成立;可选来源事实扩展既有记录,diff advisory 的零候选不替代人工语义审查。当前阻塞是新增类型检查失败,修复应限定在原有函数边界;严格质量回执仍为失败,不能用运行时通过或人工评审取代。无合并操作或权限扩展。

English verdict: REQUEST_CHANGES — 7258@cda47abc9a5cf12bb1b59f8357ff9d20c04874ae. The real native transition and default continuation pass, but this head introduces12 strict mypy diagnostics beyond the immutable integration base (5242→5254). Fix the new typing at the existing boundaries; retain provider gaps and benchmark merge holds.

Comment thread loopx/hosts/codex_checkpoint.py Outdated
raise ValueError("Codex CLI executable is unavailable")
profile = dict(project=Path(env["LOOPX_PROJECT"]), codex_bin=binary,
home=Path(env["CODEX_HOME"]), sandbox=sandbox)
observed_source = codex_session_profile_digest(**profile,

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.

[P2] Keep the new transition within the declared typecheck

The same strict mypy command and interpreter report 5,242 errors at the immutable integration base and 5,254 at this exact head: 12 added, none removed. Eight new arg-type diagnostics come from expanding this heterogeneous dict[str, object] at the two profile calls; the remaining four are the bare transition dict return, conditional kwargs expansion in _bind_verified_fork, and nullable wake.binding.get. Please use precise transition typing, explicit typed keyword arguments and a non-null binding local, then rerun python -m mypy and the transition/default native cases. This asks only to remove the newly introduced diagnostics; it does not ask this PR to repair the pre-existing 5,242 errors.

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.

Fixed in b0935227d and included in merged head 9772b95d5a4ec109c8bea72a2cf02b0af7a33e32. The transition return is dict[str, str]; both profile calls use explicit typed keywords; _bind_verified_fork passes its optional argument directly; context adoption retains a non-null binding local. No ignores or typecheck relaxation.

The declared mypy command passes on main and the repair. To include the affected modules despite the changed main import graph, I also explicitly checked all four shared checkpoint/session modules with the same interpreter and flags: 5,240 existing diagnostics on immutable main and 5,240 on the repair, with identical diagnostic text/path/multiplicity after line-number normalization. Focused suites: 115 passed; real native model-transition and default warm preparation: 2 passed; CLI/session continuation: 10 passed. Optional skips and the benchmark-sensitive manual hold remain recorded in the PR body.

The proposal now targets main and was merged by the maintainer as 6393ab60ecae1879534f36446f1fb700072711a1.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ocused change to main

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…pair-7258-main-20261024

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent requested a review from maxliux5 as a code owner October 24, 2026 15:48
@loopx-agent
loopx-agent changed the base branch from codex/edgebench-integration-v24 to main October 24, 2026 15:49
@huangruiteng
huangruiteng merged commit 6393ab6 into main Oct 24, 2026
29 of 35 checks passed
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