Skip to content

Select ordinary DSH session binding by SDK restore capability - #9894

Merged
loopx-agent merged 1 commit into
mainfrom
codex/dsh-ordinary-session-capability-20261202
Dec 2, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/dsh-ordinary-session-capability-20261202

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Change

Move the ordinary DSH session profile into the DSH adapter. Host capability session_identity_binding, matching installed SDK and bundled-runtime versions, and the SDK's resume_session method together qualify the existing binding path. The profile keeps the original digest fields and exact package versions. An existing binding can be restored after a LoopX update with the same SDK and runtime. A changed profile rejects input before a model request.

This slice uses the existing ordinary SDK transport. The CLI flags, optional dependency and operation-tool session records keep their existing behavior.

Exact packaged validation

Candidate ec72a7eebc630feeb970870245547ca98f17ef3a and matched controls used actual DSH packages, a deterministic local model endpoint, and real File and SQLite state. All 20 cases were exercised across these two backends.

  • An existing 0.2.2rc2 session produced by an earlier LoopX wheel resumed under the candidate and retained its original binding and native history. A validated warm Turn used one provider request and one quota debit. Replay added neither.
  • A new 0.2.3a3 pairing bound and restored the native session across CLI processes. Changing the model or the SDK/runtime pairing rejected an existing binding with zero new provider requests and no extra debit.
  • The older 0.1.5rc1 pairing continued without durable bindings. Explicit fresh Turns succeeded, and forcing a second unbound warm Turn reproduced the prior refusal. The candidate also refused an unbound native archive produced with the newer SDK, with no model request and no adopted binding.
  • The exact OAR candidate 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7 rejected an SDK-era session even with identical installed versions. It switches the ordinary transport and digest fields. Current main and that branch already conflict elsewhere, and this change overlaps their ordinary profile implementation. Their cross-engine compatibility needs its own integration test. OAR PR #9861
  • Standard local premerge and the changed source's Ruff and mypy checks passed. All 719 relevant tests passed, including Todo-scoped and Agent-scoped binding and replay. A full-tree maintainability advisory was inherited from main.

中文摘要

普通 DSH 根据 SDK 是否支持恢复、SDK 与打包运行时版本是否匹配来启用会话绑定。旧版 LoopX 写入的同版记录无需迁移即可续接,版本或模型变化仍会在首个模型请求前拒绝。新版 SDK 通过 File 和 SQLite 的真实运行时对照。OAR 的跨引擎会话迁移单独验收。

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.2-sol · OpenAI · runtime_reported · xhigh

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

动机 / Motivation

使用普通内置 DeepSeek Harness 的 Turn 调用者。从 0.2.2rc2 升级 LoopX 后仍运行同一 DSH 配对时,需要恢复现有 Todo 会话。新的同版且具备恢复方法的配对也应能建立并恢复自己的绑定。 原逻辑只允许 SDK 与 runtime 均为固定 0.2.2rc2 时参与普通 DSH 绑定。共同基线在 0.2.3a3 的 File 和 SQLite 首轮均调用、验收、结算各一次,但没有落下绑定。 候选允许同版且实现原生恢复的内置配对建立普通绑定。实际配对版本仍进入同一启动摘要,旧绑定可用且不会被静默改写。 独立测试安装准确提交构建的 LoopX wheel,真实 DSH SDK/配套 runtime 向隔离脚本端点发送实际请求。该端点验证历史与调用边界,未使用线上模型。

审读 ec72a7eebc630feeb970870245547ca98f17ef3a,目标基线 1c550f300955a6bb47a00b8d1629c85450c12aee。冻结对照为共同基线 1c2931339e0dd912b88f0cf52c5cd3c509ad8e44。

改动思路 / Approach

现有普通内置 DSH 的恢复资格随配对具备的能力扩展。操作工具会话与普通会话使用原有各自绑定边界。 将配对探测留在 DSH 适配器,复用共享会话存储和签名 Turn,无新字段和迁移。 受签名的 Turn 和当前 Goal 实例确定会话归属。已保存的原生会话 ID、启动摘要与原结算 journal 控制恢复与重放。 用现有配对的精确版本与可调用恢复方法判断兼容资格,保持旧摘要形状及写入校验。

具体改动 / Changes

prior-profile 原 0.2.2rc2 绑定跨版本 LoopX 可恢复。paired-runtime 无原生恢复或启动配对变化时保留原拒绝边界。session-scope 原 Todo 与签名 Agent 会话隔离,重放沿同一结算。在冻结基线用 0.2.2rc2 生成旧绑定,再以候选 wheel 续接,File 和 SQLite 同时保留绑定原字节及既有 assistant 历史。0.2.3a3 的两存储分别在候选首轮建绑定再跨进程续接。活跃 Todo 上请求 Agent scope 仍使用该 Todo 的会话。仅带签名的无 Todo 重规划建立隔离的 Agent 会话。两种续跑的精确重放都没有新增模型请求、验收或扣额。 独立覆盖真实配对 0.2.2rc2、0.2.3a3 和缺少恢复方法的 0.1.5rc1。 当前契约

关键代码讲解

  • 普通内置 Turn 在原生请求前验证现存会话的 Goal、会话 ID 和启动摘要。 _prepare_dsh_session
  • 检查同版 SDK 和 runtime、原生恢复方法及显式二进制覆盖条件。 dsh_session_profile_digest
  • 保留原摘要字段,绑定准确版本、模型、物理工作区、运行配置和 Cordis 摘要。 profile
  • 新会话确认后沿现有权限和存储路径保存绑定。 store_created

对主干的风险 / Risks

仅检查方法存在会误把另一版本或另一模型的历史带入现有绑定。持久化摘要和运行前比较必须同时保留。 File 和 SQLite 上,更换模型、配对版本或显式指定 runtime 均在模型请求、独立验收和扣额前返回 dsh_session_binding_changed,旧绑定字节保留。显式 fresh 有独立原生历史。旧 0.1.5rc1 无恢复方法时,冷启动和显式 fresh 成功,自动续接失败且零请求、零验收、零扣额,基线同样。 扩围复验 701 通过、25 跳过,ruff 通过。同一维护性告警的完整诊断与冻结基线一致。

语义与 CI 对齐

标准预合并 6 项直检通过。18/19 项选中验证通过,1 项继承告警单独归因。没有阻断执行失败。 全仓维护性检查仍报告共同基线已有的一项诊断。

我的整体评价 / Verdict

独评通过。 当前提交无阻断发现。两类存储实测确认旧绑定续接与新配对的恢复边界,换模型、版本或显式 runtime 均在发出模型请求前被拒绝。精确重放不新增结算,PR 保持开放。

English verdict: APPROVE at ec72a7e. The exact wheel resumes a frozen baseline 0.2.2rc2 binding and an independently created 0.2.3a3 binding on both File and SQLite. Model, version and explicit-runtime drift stop before model I/O. Todo and signed Agent bindings stay isolated, and exact replay adds no request, validation or debit.

@loopx-agent
loopx-agent merged commit f800663 into main Dec 2, 2026
33 checks passed
@loopx-agent
loopx-agent deleted the codex/dsh-ordinary-session-capability-20261202 branch December 2, 2026 16:36
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