[Bug] spawn 子代理未继承 agent-default-model:主会话走自定义 provider, spawn 子代理被路由到 deepseek-official #4473
|
[Bug] spawn 子代理未继承 agent-default-model:主会话走自定义 provider, 环境
预期行为
实际行为
复现步骤
影响
疑问
|
Replies: 3 comments
|
Diagnosed the mechanism in the rc.2 source: not intentional, and not the inheritance logic itself -- it is a tier split between what the parent runs and what children inherit.
Answers to your two questions:
The fix we applied in our private fork (commit export function parentLiveRoute(parent: Agent): { provider?: string; model?: string } {
const logged = parent.session.requestHeader()?.config
const provider = logged?.provider ?? parent.options.provider
const model = logged?.model ?? parent.options.model
return { ...provider !== undefined ? { provider } : {}, ...model !== undefined ? { model } : {} }
}used by both |
|
你这份取证很清楚:主会话 838 次全是 要"子代理跟着父会话当前实际在用的路由走"这个结果,可以换一条子代理运行时: dsh plugin --profile <你的 profile> add pi2dsh
dsh plugin --profile <你的 profile> add @tintinweb/pi-subagents
# 装完重启 dsh派出的子代理是真正的 DSH 会话,模型三级解析:显式指定 → 否则读调用方当前实时路由(从其会话日志最后一条 request/header 取,会话中途 边界:不修复 DSH 原生 |
|
找到根因了 买了第三方的API,子代理走官方,玩了一晚上,突然报欠费了 |
Diagnosed the mechanism in the rc.2 source: not intentional, and not the inheritance logic itself -- it is a tier split between what the parent runs and what children inherit.
Agent.options(provider/model) is frozen at session creation, seeded from the default model selection AS OF THAT MOMENT. Everything that steers the model afterwards -- the web model picker, anagent-default-modelwritten to settings mid-flight -- acts through a per-agent selection ref and theagent/requestwaterfall, then lands in the session log. The parent's own turns therefore follow the CURRENT route (your 838 consistentstealth/ox-alphaentries), butresolveChildAgentOptionsin@deepseek-ai/dsh-subagent/src/chi…