DSH / Atlas
2026-08-24implementedfeature

User-authorized subagent model routes

用户授权的 subagent 模型路由

Registering an LLM adapter makes its routes reachable, but does not authorize an Agent to choose every reachable model for a child. A single enabled preference over the live adapter registry expands silently when another provider or model appears. The product needs an explicit, stable authorization decision without rendering a potentially large model directory into every parent request.

English

Problem

Registering an LLM adapter makes its routes reachable, but does not authorize an Agent to choose every reachable model for a child. A single enabled preference over the live adapter registry expands silently when another provider or model appears. The product needs an explicit, stable authorization decision without rendering a potentially large model directory into every parent request.

Decision

The Host-owned subagent-model-selection settings section stores an explicit enabled switch and allowedModels, an array of exact { provider, model } routes. Enabling requires at least one route; disabling may retain the selected routes for later reuse. The Plugins settings card reads the live adapter directory through session/modelCatalog, lets the user stage the switch and routes, and saves both fields in one revision-fenced settings mutation. It stores no adapter-owned display names, descriptions, or reasoning-effort metadata. A stored or staged route absent from the current directory remains visible as unavailable and removable; a provider-local catalog failure does not block other providers or erase saved authorization or an unsaved selection. A connection reset discards the draft because namespace revisions are comparable only within one Host process.

Each delegation and discovery call reads the current setting; live subagent model-selection setting supersedes the per-Session snapshot this note originally recorded. When the setting is disabled or its service is absent, explicit selection remains restricted to the current parent route.

The fixed list_subagent_models schema does not enumerate the policy. At call time, it lists authorized registered providers and intersects their advertised model catalogs with the current route list. Exact lookup requires authorization before resolving model metadata and all supported reasoning efforts, including for ids absent from the catalog. When the setting is disabled, discovery resolves only the parent Agent’s current effective route, even if the catalog omits it. The delegation executor independently checks any explicit provider, model, or effort selection against the same authorization before adapter preflight. A call with no selection fields retains configured or inherited routing.

Model selection has no unrestricted static mode. The default-off Host setting authorizes alternative child routes; without it, the parent route and its supported efforts remain selectable. Each delegation tool’s modelSelection option controls only its route fields. One delegation instance per scope enables modelDiscovery to own discovery; discovery and delegation read the same settings service. Web and Desktop presets mount discovery by default, enable spawn route fields, and leave fork route fields disabled to preserve inherited-prefix reuse; custom fork compositions may enable them under the same Host authorization. Tool installation does not sample or expand authorization.

Alternatives considered

Render the allowed routes in the delegation description. Rejected because a large or changing list would enlarge every request and invalidate an early prompt prefix. On-demand discovery keeps the fixed schema prefix-stable and logs directory content only when requested.

Filter only the settings UI or discovery result. Rejected because a model can guess a route or retain one from an earlier transcript. Authorization is enforced in the executor that starts the child.

Infer enablement from a non-empty allowedModels array. Rejected because disabling would have to discard a useful selection or preserve a non-empty array whose meaning depends on write history. The explicit switch is authoritative, and the settings scope submits both fields in one Host-validated mutation so no intermediate state is persisted.

Store per-route reasoning-effort allowlists. Rejected because the user decision concerns child models, while effort ids and compatibility belong to the exact adapter route. Every adapter-supported effort remains available after the route is authorized.

Read current settings on every discovery or delegation call. Originally rejected because a settings edit would change a running Session's capabilities and execution authority; live subagent model-selection setting adopts it because users expect the setting to apply immediately.

Consequences

  • New adapter registrations and newly advertised models do not expand user authorization.
  • Adapter removal or catalog lookup failure can make provider discovery unavailable without deleting the saved route decision; an allowed model remains usable when its adapter accepts it even if the advisory catalog omits it.
  • The allowlist itself consumes no parent-request tokens. Only a list_subagent_models result enters the transcript. The modelSelection option adds three route fields; modelDiscovery adds a fixed discovery schema. Both options default off; shipped headless and SDK profiles carry neither.
  • Unit coverage pins settings validation, live reads in parent and child Sessions, shared definitions, parent-route defaults, discovery restrictions, executor denial, and the settings UI’s staged writes and revision checks. The assembled Web scenario pins the real settings document and Plugins card flow.

Related decisions

The route arguments, adapter preflight, discovery tool, and fork restriction remain owned by model-selected subagent routes.

中文

Problem

注册 LLM 适配器会使其路由可达,但不代表授权 Agent 为子级选择每一个可达模型。针对实时适配器注册表的单一启用偏好,会在另一个提供方或模型出现时静默扩大范围。产品需要一项显式且稳定的授权决定,同时避免把可能很大的模型目录渲染进父 Agent 的每次请求。

Decision

Host 自有的 subagent-model-selection 设置 section 保存显式 enabled 开关与 allowedModels,后者是由精确 { provider, model } 路由组成的数组。启用时必须至少有一条路由;关闭时可以保留已选路由,供以后重新启用。Plugins 设置卡通过 session/modelCatalog 读取实时适配器目录,让用户暂存开关与路由,再在一次带 revision 限制的设置 mutation 中保存两个字段。它不保存适配器自有的显示名称、描述或推理强度元数据。当前目录中缺失的已存或暂存路由仍显示为不可用并允许移除;某个提供方的目录失败不会阻塞其他提供方,也不会清除已存授权或未保存选择。连接重置会丢弃草稿,因为 namespace revision 只能在同一个 Host 进程内比较。

每次委派和发现调用都读取当前设置;实时读取的 subagent 模型选择设置取代了本 Agent Note 最初记录的逐 Session 快照。设置关闭或其服务缺失时,显式选择仍仅限当前父级路由。

固定的 list_subagent_models schema 不枚举策略。调用时,它列出已授权且已注册的提供方,并取其公布模型目录与当前路由列表的交集。精确查询先要求授权,再解析模型元数据及全部支持的推理强度,也允许目录未列出的 ID。设置关闭时,发现只解析父 Agent 当前生效的路由,即使目录未列出它。委派执行器会在适配器预检前独立校验显式提供方、模型或强度选择是否符合相同授权。没有选择字段的调用保留配置或继承的路由。

模型选择没有无限制的静态模式。默认关闭的 Host 设置授权其他子级路由;没有该授权时,仍可选择父级路由及其支持的强度。各委派工具的 modelSelection 选项只控制自身路由字段。每个作用域的一个委派实例启用 modelDiscovery 并负责发现;发现和委派读取同一个设置服务。Web 与 Desktop preset 默认挂载发现工具,启用 spawn 路由字段,并为 fork 保持关闭,以保留对继承前缀的复用;自定义 fork 组合可以在相同 Host 授权下启用这些字段。工具安装不采样或扩大授权。

Alternatives considered

在委派描述中渲染允许路由。 不采用,因为很大或变化的列表会扩大每次请求,并使较早的提示词前缀失效。按需发现会保持固定 schema 的前缀稳定,且只在请求目录时记录其内容。

只过滤设置 UI 或发现结果。 不采用,因为模型可以猜测路由,或从较早的 transcript 中保留路由。授权由启动子级的执行器强制执行。

从非空 allowedModels 数组推断是否启用。 不采用,因为关闭功能时要么必须丢弃仍有用的选择,要么要保留一个含义取决于写入历史的非空数组。显式开关是权威依据,设置 scope 会在一次由 Host 校验的 mutation 中提交两个字段,因此不会持久化中间状态。

保存每条路由的推理强度允许列表。 不采用,因为用户决定针对子级模型,而强度 id 与兼容性属于精确适配器路由。路由获准后,仍可使用适配器支持的每种强度。

每次发现或委派调用都读取当前设置。 最初不采用,因为设置编辑会改变运行中 Session 的能力和执行权限;实时读取的 subagent 模型选择设置采用了它,因为用户期望设置立即生效。

Consequences

  • 新适配器注册和新公布模型不会扩大用户授权。
  • 适配器移除或目录查询失败可能使提供方发现不可用,但不会删除已存路由决定;只要适配器接受某个获准模型,即使建议性目录省略它,该模型仍可使用。
  • 允许列表本身不消耗父级请求 token。只有 list_subagent_models 结果进入 transcript。modelSelection 选项增加三个路由字段;modelDiscovery 增加固定发现 schema。两个选项都默认关闭;随附 headless 与 SDK profile 两者都不携带。
  • 单元覆盖固定设置校验、父子 Session 中的实时读取、共享定义、父级路由默认值、发现限制、执行器拒绝,以及设置 UI 的暂存写入与 revision 检查。组装 Web 场景固定真实设置文档与 Plugins 设置卡流程。

Related decisions

路由参数、适配器预检、发现工具与 fork 限制仍由模型选择的 subagent 路由负责。