Repository navigation
Replies: 1 comment
EN / EnglishWhat we can add from the sources — as a boundary, not a verdict. @xie-tj, we went to read this path because a nearby form of it (the cost-tier side of the same delegation gate) came up in a thread we were already in — #5973. Four things we could verify, and one question we would ask instead. ① The allowlist check returns early unless the call itself names a route. The predicate is "did the request carry ② The function says so itself, in its own docstring. master
③ The Agent Note says the same thing — one paragraph after the sentence cited in the report. The report quotes
and, immediately before it:
Read together, "always carries an exact allowlist" appears to mean there is no unrestricted mode — the scope is set by the next sentences, which bound explicit selections. ④ master and the published build agree — so this is not a fix awaiting release. The early return and the docstring are character-for-character the same on master and in The question we would ask instead. The behaviour above looks deliberate, so the useful question seems to be about scope of the authorization, not about a missing check. There are three authorities in play on this path, and they do not line up:
⇒ So: is the intended scope "choices the model makes", or "whatever route the child actually runs on"? If it is the former, the current behaviour is the documented design and the report's expectation is one sentence wider than the Note. If it is the latter, then the middle row looks like the interesting one — a deployment-owned route can reach a child in a Session whose user has authorized a different list — and that would be a policy-scope decision rather than a defect in this check. We are not claiming either. We are noting that the Note's own wording reads as the former, while the report's "Expected" clause reads as the latter, and that gap looks worth resolving in one sentence of documentation regardless of which way it goes. Honest boundaries. Static reading of the published packages and of master — we did not reproduce your run, and we do not have your settings composition (which toggle was on, and whether Authorship note: reproduced and documented by me in real-world usage; root-cause tracing and drafting assisted by AI; verification and publication by me. I have no engineering background — if any technical claim reads wrong, please call it out; I will re-verify against the toolchain and correct. Reported by the OfferKuai Team — Founder: Zhaofeng (Yaming). Website: https://www.offerkuai.com/ | Contact: contact@offerkuai.com 中文版 / ZH我们能从材料里补的 —— 是一处边界,不是一个判词。 @xie-tj,我们读这条路径,是因为它的邻形态(同一个委派闸门的成本侧)出现在我们已经在跟的 #5973 里。以下四点是能核实的,外加一个我们更想问的问题。 ① 除非「调用自己点名了路由,否则白名单检查会提前返回。** 判据是「请求里有没有带 ② 这个函数在自己的注释里就写明了。 master
③ 官方 Agent Note 说的是同一件事 —— 就在报告引用的那句的下一段。 报告引用
以及紧接在前的一句:
合起来读,「总是携带一份精确白名单」看起来是在说「不存在不受限的模式」—— 而作用域由紧接着的句子界定:它约束的是显式选择。 ④ master 与已发布构建一致 —— 所以这不是"等发布"的修复。 那句提前返回与那段注释,在 master 与 我们更想问的问题。 上面的行为看起来是有意为之,所以有用的问题或许是授权的作用域,而不是漏了一处检查。这条路径上有三种权威,而它们并不对齐:
⇒ 所以:官方想要的作用域,是"模型做出的选择",还是"子代理实际跑在哪个路由上"?
我们不主张是其中任何一边。 我们只是指出:Note 的措辞读起来是前者,报告的"Expected"读起来是后者 —— 无论最后倒向哪边,这个落差值得用一句话的文档说清。 诚实边界。 以上是对已发布包与 master 的静态阅读 —— 我们没有复现你的那次运行,也没有你的设置组合(哪个开关开着、那个 profile 里 协作说明:本文由我在真实使用中复现并记录;根因与成文由 AI 协助完成,我负责校验与发布。我非工程背景,技术表述如有错误,欢迎指出——我会回去用工具链重新验证后更正。 本报告由 OfferKuai(Offer快)团队提交 —— 创始人:Zhaofeng(Yaming)。官网:https://www.offerkuai.com/ | 联系:contact@offerkuai.com |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When a Session has the model-selection allowlist enabled (
subagent/model-selection-policy), asubagentcall that omitsprovider/modelskips the allowlist entirely and can start a child on a route the user never authorized.Reproduced on
0.1.6-alpha.2(Web profile,dsh web).Reproduction
openai-codex/gpt-5.6-lunaandopencode-go/deepseek-v4.1-flash.Observed: the child starts and answers
gpt-5.6-terra— the parent Agent's route, which is not in the allowlist.Expected: rejection before child creation, since an enabled Session "always carries an exact allowlist" (per the Agent Note
2026-08-24-user-authorized-subagent-model-routes).Root cause
packages/subagent/tool-subagent/src/model-selection.ts,assertAllowedModelSelection():The guard returns early unless the call supplied a model-facing field. But the effective route can also come from
Config.agentOptions,provider.agentRouteDefaults, or the parent Agent's inherited route — andsrc/index.tsonly preflighted when a model-facing field or configured LLM selection was present:So an omitted-route delegation reached
ctx.subagents.start()on an unchecked route. Naming the model explicitly is rejected correctly — only the omitted path bypasses the policy.Note this also means
list_subagent_modelsoutput and the enforced route set disagree: the catalog is documented as advisory, but for the omitted path nothing else constrained the route at all.Local fix I validated
Enforce the policy on the effective route from every layer, and preflight whenever a policy exists:
After this, the same call rejects before child creation:
and an explicitly allowed route still starts and reports
gpt-5.6-luna.Behavior change to be aware of: with an enabled policy, a Session whose default/inherited route is not in the allowlist will now reject instead of silently delegating. Deployments that want a default child route must list it.
Evidence
Branch (fork):
xie-tj/deepseek-harness,agent/subagent-effective-route-authorization, commitc19f4043d8, based onmaster@ddefc45fbc(0.1.6-alpha.2). 21 files, +183/−57.Validation in that worktree:
pnpm exec vitest run packages/subagent/tool-subagent/tests— 131 passedpnpm run typecheck— passedpnpm exec vitest run --config vitest.snapshot.config.ts -t "subagent-dsh-sdk-dynamic-route"— passedpnpm run test:docs— 20 gates passedThe change covers: unit tests for parent-inherited / configured / provider-default routes outside the policy (all rejected before child creation, plus an authorized provider default that still starts), an SDK snapshot that now omits the route and inherits it through a real
dsh --profile sdkchild runtime, both README languages, the two owning Agent Notes, a new Agent NoteEffective subagent route authorization, and the generated persistence catalog.CONTRIBUTING.mdsays external pull requests are not accepted, so I am reporting it here rather than opening a PR. Happy to hand over the branch or a patch if that helps.Related
SubagentRuntimedirectly.All reactions