Repository navigation
Select Turn session scope from built-in host capabilities - #9898
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
调用 turn plan 与 turn run-once 的普通 DSH、Codex 及其他受支持宿主。计划与启动重查需要读取执行适配器的同一能力声明,同时保留 Codex 原生线程、普通 DSH Todo 会话、受签名无 Todo 重规划的既有隔离。 冻结基线在作用域选择和计划校验中列举宿主名称。普通 DSH 默认为 Todo,Codex 原生线程默认为 Agent。 候选从实际选定的内置描述读取两项现有能力。支持组合、默认值及无 Todo 的签名条件保持原有语义。 独立复验用精确源码和真实 SDK/配套 DSH runtime,脚本 loopback 模型端点。作者提供另外的安装 wheel 和外来身份案例。Codex 与其他宿主在独立计划矩阵及回归套件中覆盖。
审读 1146e933c1544c855b85cd00bcaa093915e1b41f,目标基线 abbd0fad2f564344cf52bb1db01a59b4078b40d4。
改动思路 / Approach
变更限于 builtin 能力选择与计划校验。保持 Todo/Agent 路由及既有持久化合同。 用已有声明代替重复的宿主枚举,仍以支持的 Turn 入口清单约束执行。复用原签名判定和 journal。 支持的 Turn 宿主清单和实际内置描述决定能力,再由原签名重规划合同、Goal/Agent/obligation/Turn 身份及现有启动重查决定执行。 复用不可由展示覆盖替换的既有内置宿主描述,保留操作入口与签名守卫。
具体改动 / Changes
builtin-authority 展示覆盖不授予执行会话权限。ordinary-and-signed-scopes 原生线程默认值和签名 DSH 作用域保持。signed-lineage 受签名的无 Todo 当前实例才获准 Agent 作用域。冻结基线和当前提交各在 File 和 SQLite 使用实际内置 DSH 0.2.2rc2。活跃 Todo 上显式请求 Agent 仍沿原 Todo 历史和绑定,之后带签名的无 Todo 重规划创建不同 Agent 会话。两个作用域精确重放均零模型请求、零独立验收、零扣额。 Codex CLI/app-server 的原生线程默认 Agent,显式 Todo、委托与操作工具分支保留。Claude Code 和 generic-cli 的普通分支仍为 Todo。 当前契约
关键代码讲解
- 按精确运行宿主的内置模块返回描述,展示注册表没有执行权限。 get_builtin_host_capabilities
- 共享规划和启动决策,区分 managed thread 与仅身份绑定两种能力。 resolve_turn_session_scope
- 仅身份绑定且选 Agent scope 时仍验证当前受签名的无 Todo 重规划身份。 _validate_agent_session_scope
- 验证展示覆盖无法改变 DSH 或 generic-cli 的计划权限。 test_session_scope_uses_builtin_capabilities_over_registry_overrides
对主干的风险 / Risks
若从可写展示注册表授予原生会话能力,可能让不具备权限的普通宿主选择 Agent 作用域。 展示注册表即使注册支持原生线程和身份绑定的替代描述,真实 DSH 与 generic-cli 的普通请求仍选 Todo,直接构造 Agent 计划仍被拒。带签名的无 Todo DSH 显式选 Todo 或自定义 runner、operation module 时不得启动。运行期更换模型与版本的原拒绝也通过隔离复验。 714 个扩围回归通过。另有 432 个作用域组合和 30 个计划组合的完整对照结果相同。
语义与 CI 对齐
标准预合并 6 项直检通过。16/17 项选中验证通过,1 项继承告警单独归因。没有阻断执行失败。 标准预合并无阻断。唯一维护性告警的完整结果与冻结基线一致。
我的整体评价 / Verdict
独评通过。 当前提交无阻断发现。宿主能力的读取来源改为真实内置描述,签名重规划与普通 Todo 的既有隔离通过实际 File 和 SQLite 复验。原生线程默认值和拒绝边界的对照一致,PR 保持开放。
English verdict: APPROVE at 1146e93. The frozen base and exact head agree across 432 scope selections and 30 plan cases. Real DSH on File and SQLite keeps ordinary Todo history and an isolated signed Agent session. Registry overrides do not grant execution scope, and replay incurs no additional host call, validation, or debit.
Change
Derive Turn session scope from the selected built-in adapter's existing
session_identity_bindingandmanaged_thread_resumecapabilities. Planning and launch recheck now use the same scope selection. A managed thread keeps the conversation scope it already supported. An identity-only adapter can use Agent scope only for the existing signed Todo-less autonomous replan path. Ordinary DSH, explicit DSH runners and operation-module paths keep their existing Todo rules.The scope lookup uses the installed built-in descriptor. Runtime registry customizations remain available to capability presentation and cannot broaden launch scope. The signed source checks, TypeScript session decision, flags, and persisted session paths and receipts retain their existing behavior.
Validation
abbd0fad2f564344cf52bb1db01a59b4078b40d4and exact candidate1146e933c1544c855b85cd00bcaa093915e1b41fusing both installed wheels and the real DSH0.2.2rc2runtime with a deterministic loopback provider. The 16 File/SQLite cases cover ordinary DSH with explicit--session-scope agent, an existing Todo-scoped binding, and separate foreign Goal, Agent and Todo fields. A valid original binding resumes once and replays with no additional model request or debit. Each foreign record is refused before a model request, and the existing file is preserved.中文摘要
规划和启动重查都由内置宿主的现有能力决定会话作用域。普通 DSH 仍按 Todo 隔离,已签名的无 Todo 自治重规划仍可按 Agent 恢复。展示注册表的覆盖不改变实际权限。File 和 SQLite 的真实 DSH 打包对照证明旧绑定可续接,归属不匹配会在模型调用前拒绝,重放无重复扣额。