diff --git a/apps/web/tests/smoke-real.e2e.ts b/apps/web/tests/smoke-real.e2e.ts index a980c2d02d..d763d6847a 100644 --- a/apps/web/tests/smoke-real.e2e.ts +++ b/apps/web/tests/smoke-real.e2e.ts @@ -606,6 +606,7 @@ describe('dsh web keyless CLI smoke', () => { it.each(['native', 'ptc'] as const)('selects the %s executor through profile overlays and ignores the retired environment selector', async (mode) => { requireDist() const workspace = mkdtempSync(join(tmpdir(), 'dsh-web-ptc-')) + const promptMarker = `WEB_EXECUTOR_${mode}_${randomUUID()}` interface PtcModeProviderRequest { system?: string @@ -621,7 +622,11 @@ describe('dsh web keyless CLI smoke', () => { request.setEncoding('utf8') request.on('data', (chunk: string) => { body += chunk }) request.on('end', () => { - resolveProviderRequest(JSON.parse(body) as PtcModeProviderRequest) + const parsed = JSON.parse(body) as PtcModeProviderRequest + const messages = JSON.stringify(parsed.messages ?? []) + if (messages.includes(promptMarker) && !messages.includes(TITLE_PROMPT_MARKER)) { + resolveProviderRequest(parsed) + } response.writeHead(200, { 'content-type': 'text/event-stream' }) response.end(messagesResponse('done')) }) @@ -653,11 +658,19 @@ describe('dsh web keyless CLI smoke', () => { try { const baseUrl = await waitForReadyLine(child) const created = await remoteRpc<{ sessionId: string }>(baseUrl, 'session/create', { request: {} }) + // Title requests share the provider; exercise auxiliary-first arrival explicitly. + await fetch(`http://127.0.0.1:${address.port}`, { + method: 'POST', + body: JSON.stringify({ messages: [{ + role: 'user', + content: [{ type: 'text', text: `${TITLE_PROMPT_MARKER}\n${JSON.stringify([promptMarker])}` }], + }] }), + }).then(response => response.text()) await remoteRpc<{ accepted: true }>(baseUrl, 'session/prompt', { request: { requestId: randomUUID(), sessionId: created.sessionId, mode: 'queue', - content: [{ type: 'text', text: 'go' }], + content: [{ type: 'text', text: promptMarker }], } }) const captured = await Promise.race([ providerRequest, diff --git a/docs/config-catalog.md b/docs/config-catalog.md index 57e8f5bccb..b60380b102 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -4323,7 +4323,7 @@ export interface Config { - `inject`: `tools` · `subagents` · `systemPrompt` · `sessionProjections` - `refs`: [`AgentOptions`](subsystems/core.md) -- `source`: [`packages/subagent/tool-subagent/src/index.ts:46`](../packages/subagent/tool-subagent/src/index.ts) +- `source`: [`packages/subagent/tool-subagent/src/index.ts:45`](../packages/subagent/tool-subagent/src/index.ts) ```ts config-catalog /** Config: which registered provider this tool delegates to, plus child defaults. */ diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md index bc03ae4b7a..95af04f5dd 100644 --- a/docs/config-catalog.zh.md +++ b/docs/config-catalog.zh.md @@ -4325,7 +4325,7 @@ export interface Config { - `inject`: `tools` · `subagents` · `systemPrompt` · `sessionProjections` - `refs`: [`AgentOptions`](subsystems/core.zh.md) -- `source`: [`packages/subagent/tool-subagent/src/index.ts:46`](../packages/subagent/tool-subagent/src/index.ts) +- `source`: [`packages/subagent/tool-subagent/src/index.ts:45`](../packages/subagent/tool-subagent/src/index.ts) ```ts config-catalog /** Config: which registered provider this tool delegates to, plus child defaults. */ diff --git a/docs/tool-catalog.i18n.yaml b/docs/tool-catalog.i18n.yaml index 9fb0d405f9..971ca58759 100644 --- a/docs/tool-catalog.i18n.yaml +++ b/docs/tool-catalog.i18n.yaml @@ -246,7 +246,7 @@ en: 841abe0dd5913ea7 zh: 841abe0dd5913ea7 /tool-schema-catalog/deepseek-ai-dsh-tool-subagent/list-subagent-models: - en: 5305b142f880704f + en: 0fdfb665c6716691 zh: 36e9344ee1af8869 /tool-schema-catalog/deepseek-ai-dsh-tool-subagent/subagent: en: 430672da3c1a6ca6 diff --git a/docs/tool-catalog.md b/docs/tool-catalog.md index d3ee517f7c..59fc07d30d 100644 --- a/docs/tool-catalog.md +++ b/docs/tool-catalog.md @@ -2039,7 +2039,7 @@ The subagent_oar tool selects among configured aliases for external providers. T ### `list_subagent_models` -Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings. +Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings. ```json { diff --git a/packages/subagent/tool-subagent/README.i18n.yaml b/packages/subagent/tool-subagent/README.i18n.yaml index 6cfba28b82..d2865939db 100644 --- a/packages/subagent/tool-subagent/README.i18n.yaml +++ b/packages/subagent/tool-subagent/README.i18n.yaml @@ -69,8 +69,8 @@ en: a4ca31b9cbacda6b zh: 91ac3e0784a14697 /deepseek-ai-dsh-tool-subagent/model-experience/model-selection-and-discovery/what-the-model-sees: - en: 72beb892cd518faa - zh: 5ee151e6eae18849 + en: 44bd1c2d49d0bbc1 + zh: 7ae63df1cc3f56f2 /deepseek-ai-dsh-tool-subagent/model-experience/model-selection-and-discovery/token-effect: en: 3a55d6616c00746b zh: 4b0ef3dbff2c67ce diff --git a/packages/subagent/tool-subagent/README.md b/packages/subagent/tool-subagent/README.md index 24f122438f..455c2461f5 100644 --- a/packages/subagent/tool-subagent/README.md +++ b/packages/subagent/tool-subagent/README.md @@ -153,7 +153,7 @@ Prefix-stable while provider instances and their configuration are unchanged. Ad #### What the model sees -The optional `list_subagent_models` definition reads the calling Session’s route policy, falling back to the current parent route when no policy is recorded. Calls reject while the optional `ctx.llm` service is unavailable. With a recorded policy, provider model lists intersect the advertised catalog with the Session’s authorized routes. Without one, they resolve only the current parent model, even if the catalog omits it. The discovery tool’s own description tells the model to query when selecting a child route or effort, to omit all three selection fields for the default child route, and to omit optional fields rather than send empty strings; omitting or filtering out discovery removes that guidance. Exact-model queries accept authorized ids absent from the catalog; unauthorized provider/model lookups fail before adapter access. Catalog or exact-model lookup failures and cancellation reject the call. Execution independently enforces the same policy. +The optional `list_subagent_models` definition reads the calling Session’s route policy, falling back to the current parent route when no policy is recorded. Calls reject while the optional `ctx.llm` service is unavailable. With a recorded policy, provider model lists intersect the advertised catalog with the Session’s authorized routes. Without one, they resolve only the current parent model, even if the catalog omits it. The discovery tool’s description tells the model when to query child routes or efforts and to omit optional query fields rather than send empty strings. Delegation tools document their own selection fields and defaults. Exact-model queries accept authorized ids absent from the catalog; unauthorized provider/model lookups fail before adapter access. Catalog or exact-model lookup failures and cancellation reject the call. Execution independently enforces the same policy. #### Token effect diff --git a/packages/subagent/tool-subagent/README.zh.md b/packages/subagent/tool-subagent/README.zh.md index b9cdfe3c3a..aec498cc49 100644 --- a/packages/subagent/tool-subagent/README.zh.md +++ b/packages/subagent/tool-subagent/README.zh.md @@ -153,7 +153,7 @@ kind: "package-reference" #### 模型看到什么 -可选的 `list_subagent_models` 定义读取调用 Session 的路由策略,没有已记录策略时使用当前父级路由。可选的 `ctx.llm` 服务不可用时,调用会被拒绝。有已记录策略时,提供方模型列表取公布目录与 Session 授权路由的交集。没有策略时,只解析当前父级模型,即使目录未列出它。发现工具自身的描述要求模型在选择子级路由或强度时查询,说明省略全部三个选择字段会使用默认子级路由,且可选字段应省略而不是传空字符串;未挂载或过滤掉发现工具时,这段指导也不会出现。精确模型查询允许已授权但目录未列出的 ID;未授权的提供方/模型查询会在访问适配器前失败。目录或精确模型查询失败以及取消都会使调用被拒绝。执行过程独立强制同一策略。 +可选的 `list_subagent_models` 定义读取调用 Session 的路由策略,没有已记录策略时使用当前父级路由。可选的 `ctx.llm` 服务不可用时,调用会被拒绝。有已记录策略时,提供方模型列表取公布目录与 Session 授权路由的交集。没有策略时,只解析当前父级模型,即使目录未列出它。发现工具的描述说明何时查询子级路由或强度,并要求省略可选查询字段而不是传空字符串。委派工具各自说明选择字段及其默认行为。精确模型查询允许已授权但目录未列出的 ID;未授权的提供方/模型查询会在访问适配器前失败。目录或精确模型查询失败以及取消都会使调用被拒绝。执行过程独立强制同一策略。 #### Token 影响 diff --git a/packages/subagent/tool-subagent/src/index.ts b/packages/subagent/tool-subagent/src/index.ts index 0481a44520..dcb7395683 100644 --- a/packages/subagent/tool-subagent/src/index.ts +++ b/packages/subagent/tool-subagent/src/index.ts @@ -21,7 +21,6 @@ import { } from '@deepseek-ai/dsh-subagent' import type { SubagentProvider } from '@deepseek-ai/dsh-subagent' import { - assertAllowedModelSelection, hasConfiguredLlmSelection, hasDelegationModelRequest, preflightChildLlmRoute, @@ -203,8 +202,8 @@ export async function apply(ctx: Context, config: Config): Promise { const wording = providerWording(subagentProvider.inheritsParentContext) const providerRouteDefaults = subagentProvider.agentRouteDefaults const selectionDescription = providerRouteDefaults !== undefined - ? ' Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to this backend\'s route defaults. An explicit route without `reasoning_effort` uses that model\'s default effort, even when the route is unchanged.' - : ' Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model\'s default effort, even when the route is unchanged.' + ? ' Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to this backend\'s route defaults.' + : ' Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values.' const definition = defineTool({ name: toolName, description: wording.description @@ -242,7 +241,7 @@ export async function apply(ctx: Context, config: Config): Promise { ...modelSelectionEnabled ? { provider: { type: 'string' as const, - description: 'Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route.', + description: 'Child LLM provider id; requires `model`.', }, model: { type: 'string' as const, @@ -250,7 +249,7 @@ export async function apply(ctx: Context, config: Config): Promise { }, reasoning_effort: { type: 'string' as const, - description: 'Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model\'s default effort.', + description: 'Reasoning effort id; requires `provider` and `model`. Omit to use the selected model\'s default, even when it matches the parent or configured route.', }, } : {}, }, @@ -288,24 +287,21 @@ export async function apply(ctx: Context, config: Config): Promise { configuredChildAgentOptions, modelRequest, modelSelectionEnabled, - ) - assertAllowedModelSelection( modelSelectionPolicy, parentOptions, - requestedChildAgentOptions, - modelRequest, ) if (requiresRoutePreflight) { const llm = ctx.get('llm') if (llm === undefined) { throw new Error('cannot resolve the selected child LLM route because the `llm` service is unavailable') } + const inheritParentReasoningEffort = providerRouteDefaults === undefined && !hasDelegationModelRequest(modelRequest) await preflightChildLlmRoute( llm, parentOptions, requestedChildAgentOptions, exec.signal, - providerRouteDefaults === undefined && !hasDelegationModelRequest(modelRequest), + inheritParentReasoningEffort, ) if (ctx.subagents.getProvider(config.provider) !== subagentProvider) { throw new Error(`subagent provider "${config.provider}" changed while resolving the child LLM route; retry the delegation`) diff --git a/packages/subagent/tool-subagent/src/list-models.ts b/packages/subagent/tool-subagent/src/list-models.ts index f0e246d2a7..13eb14d94e 100644 --- a/packages/subagent/tool-subagent/src/list-models.ts +++ b/packages/subagent/tool-subagent/src/list-models.ts @@ -111,7 +111,7 @@ export function registerListSubagentModels( description: 'Inspect the subagent routes this Session authorizes. No arguments: authorized providers. ' + '`provider`: that provider\'s authorized models. `provider` + `model`: that model and its reasoning efforts. ' - + 'Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. ' + + 'Query when choosing an explicit child route or reasoning effort. ' + 'Omit optional fields rather than sending empty strings.', parameters: { provider: { diff --git a/packages/subagent/tool-subagent/src/model-selection.ts b/packages/subagent/tool-subagent/src/model-selection.ts index 6edac9b973..cadeff0efe 100644 --- a/packages/subagent/tool-subagent/src/model-selection.ts +++ b/packages/subagent/tool-subagent/src/model-selection.ts @@ -87,18 +87,22 @@ function assertNonEmpty(value: string | undefined, field: keyof DelegationModelR } /** - * Merge model-supplied selection fields over configured child defaults. + * Validate explicit selection against the Session policy and merge it over child defaults. * Explicit selection requires both provider and model; an omitted effort then * uses the selected model's default, even when the route is unchanged. * @param configured - Tool-instance child defaults. * @param request - Model-facing route override. * @param enabled - Whether this tool instance permits model-facing selection. + * @param policy - Session allowlist; omission permits only the current parent route. + * @param parentOptions - Current parent route used when no policy is recorded. * @returns Child Agent options, preserving omission when no layer contributes one. */ export function requestedAgentOptions( configured: AgentOptions | undefined, request: DelegationModelRequest, enabled: boolean, + policy: ModelSelectionPolicy | undefined, + parentOptions: AgentOptions, ): AgentOptions | undefined { if (!hasDelegationModelRequest(request)) return configured if (!enabled) { @@ -113,6 +117,7 @@ export function requestedAgentOptions( : 'child LLM `reasoning_effort` requires both `provider` and `model`; supply both or omit all three fields') } + assertAllowedModelSelection(policy, parentOptions, { provider: request.provider, model: request.model }) return { ...configured, provider: request.provider, @@ -123,33 +128,24 @@ export function requestedAgentOptions( } /** - * Enforce a settings-owned route list at the operation that creates the child. - * Pure inheritance remains outside this policy because no model-facing choice - * occurred; any explicit route or effort field must resolve to an allowed route. + * Enforce Session authorization for a complete, explicitly selected child route. * @param policy - Session allowlist; omission permits only the current parent route. - * @param parentOptions - Current parent values that supply missing child values. - * @param requested - Effective child options after request/config merging. - * @param request - Model-facing selection fields from the tool call. + * @param parentOptions - Current parent route used when no policy is recorded. + * @param route - Validated provider/model pair from the tool call. */ export function assertAllowedModelSelection( policy: ModelSelectionPolicy | undefined, parentOptions: AgentOptions, - requested: AgentOptions | undefined, - request: DelegationModelRequest, + route: AllowedModelRoute, ): void { - if (!hasDelegationModelRequest(request)) return - const provider = requested?.provider ?? parentOptions.provider - const model = requested?.model ?? parentOptions.model - if (provider === undefined || model === undefined) { - throw new Error('cannot select child LLM values without an effective provider and model') - } + const { provider, model } = route const allowed = policy === undefined ? provider === parentOptions.provider && model === parentOptions.model : policy.routes.some(route => route.provider === provider && route.model === model) if (allowed) return throw new Error(`child LLM route "${provider}/${model}" is not allowed for this Session` + (policy === undefined - ? '; without a recorded model-selection policy, explicit selection (including reasoning_effort) is limited to the parent route' + ? '; without a recorded model-selection policy, explicit selection is limited to the parent route' : '')) } @@ -172,7 +168,7 @@ export function hasConfiguredLlmSelection(options: AgentOptions | undefined): bo * @param parentOptions - Current parent values whose compatible fields the child inherits. * @param requested - Per-child options after request/config merging. * @param signal - Tool-call cancellation signal. - * @param inheritParentReasoningEffort - Whether an omitted effort may inherit from the parent route. + * @param inheritParentReasoningEffort - Whether an omitted effort may inherit from the parent route; false for explicit model selection. */ export async function preflightChildLlmRoute( llm: LlmRuntime, diff --git a/packages/subagent/tool-subagent/tests/model-selection.spec.ts b/packages/subagent/tool-subagent/tests/model-selection.spec.ts index b8459b8d65..2761f70c8a 100644 --- a/packages/subagent/tool-subagent/tests/model-selection.spec.ts +++ b/packages/subagent/tool-subagent/tests/model-selection.spec.ts @@ -52,45 +52,21 @@ describe('dsh-tool-subagent model selection', () => { .toThrow('requires non-empty provider and model ids') }) - it('allows pure inheritance but rejects explicit values outside a Session allowlist', () => { - const policy = { - routes: [{ provider: 'alpha', model: 'allowed-model' }], - } + it('checks complete explicit routes against Session authorization or the current parent route', () => { + const policy = { routes: [{ provider: 'alpha', model: 'allowed-model' }] } const parent = { provider: 'alpha', model: 'parent-model' } - - expect(() => { assertAllowedModelSelection(policy, parent, undefined, {}) }).not.toThrow() expect(() => { - assertAllowedModelSelection( - policy, - parent, - { provider: 'alpha', model: 'allowed-model' }, - { provider: 'alpha', model: 'allowed-model' }, - ) + assertAllowedModelSelection(policy, parent, { provider: 'alpha', model: 'allowed-model' }) }).not.toThrow() expect(() => { - assertAllowedModelSelection( - policy, - parent, - { provider: 'alpha', model: 'other-model' }, - { provider: 'alpha', model: 'other-model' }, - ) - }).toThrow('is not allowed for this Session') - expect(() => { - assertAllowedModelSelection( - policy, - parent, - { reasoningEffort: ReasoningEffortId('low') }, - { reasoning_effort: 'low' }, - ) + assertAllowedModelSelection(policy, parent, parent) }).toThrow('alpha/parent-model') expect(() => { - assertAllowedModelSelection( - policy, - {}, - { reasoningEffort: ReasoningEffortId('low') }, - { reasoning_effort: 'low' }, - ) - }).toThrow('without an effective provider and model') + assertAllowedModelSelection(undefined, parent, parent) + }).not.toThrow() + expect(() => { + assertAllowedModelSelection(undefined, parent, { provider: 'alpha', model: 'other-model' }) + }).toThrow('explicit selection is limited to the parent route') }) it('leaves deployment or parent defaults outside the allowlist usable when the call selects nothing', async () => { diff --git a/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json b/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json index ea655cea0a..3dae46331d 100644 --- a/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json +++ b/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json @@ -265,7 +265,7 @@ }, { "name": "list_subagent_models", - "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings.", + "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.", "parameters": { "type": "object", "properties": { @@ -359,7 +359,7 @@ }, { "name": "subagent", - "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. This backend does not accept follow-up messages. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to this backend's route defaults. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged.", + "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. This backend does not accept follow-up messages. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to this backend's route defaults.", "parameters": { "type": "object", "properties": { @@ -377,7 +377,7 @@ }, "provider": { "type": "string", - "description": "Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route." + "description": "Child LLM provider id; requires `model`." }, "model": { "type": "string", @@ -385,7 +385,7 @@ }, "reasoning_effort": { "type": "string", - "description": "Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort." + "description": "Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route." } }, "required": [ diff --git a/snapshots/web/creation-recommendations/tool-schemas.expected.json b/snapshots/web/creation-recommendations/tool-schemas.expected.json index fbb392d6cc..bfcd5cbc2e 100644 --- a/snapshots/web/creation-recommendations/tool-schemas.expected.json +++ b/snapshots/web/creation-recommendations/tool-schemas.expected.json @@ -328,7 +328,7 @@ }, { "name": "list_subagent_models", - "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings.", + "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.", "parameters": { "type": "object", "properties": { @@ -643,7 +643,7 @@ }, { "name": "subagent", - "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged.", + "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values.", "parameters": { "type": "object", "properties": { @@ -661,7 +661,7 @@ }, "provider": { "type": "string", - "description": "Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route." + "description": "Child LLM provider id; requires `model`." }, "model": { "type": "string", @@ -669,7 +669,7 @@ }, "reasoning_effort": { "type": "string", - "description": "Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort." + "description": "Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route." } }, "required": [ @@ -1290,7 +1290,7 @@ }, { "name": "list_subagent_models", - "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings.", + "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.", "parameters": { "type": "object", "properties": { @@ -1637,7 +1637,7 @@ }, { "name": "subagent", - "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged.", + "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values.", "parameters": { "type": "object", "properties": { @@ -1655,7 +1655,7 @@ }, "provider": { "type": "string", - "description": "Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route." + "description": "Child LLM provider id; requires `model`." }, "model": { "type": "string", @@ -1663,7 +1663,7 @@ }, "reasoning_effort": { "type": "string", - "description": "Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort." + "description": "Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route." } }, "required": [ diff --git a/snapshots/web/fresh-round-trip/tool-schemas.expected.json b/snapshots/web/fresh-round-trip/tool-schemas.expected.json index 41935f0cdc..817748bec6 100644 --- a/snapshots/web/fresh-round-trip/tool-schemas.expected.json +++ b/snapshots/web/fresh-round-trip/tool-schemas.expected.json @@ -328,7 +328,7 @@ }, { "name": "list_subagent_models", - "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings.", + "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.", "parameters": { "type": "object", "properties": { @@ -643,7 +643,7 @@ }, { "name": "subagent", - "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged.", + "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values.", "parameters": { "type": "object", "properties": { @@ -661,7 +661,7 @@ }, "provider": { "type": "string", - "description": "Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route." + "description": "Child LLM provider id; requires `model`." }, "model": { "type": "string", @@ -669,7 +669,7 @@ }, "reasoning_effort": { "type": "string", - "description": "Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort." + "description": "Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route." } }, "required": [ diff --git a/snapshots/web/official-subagent-bundle/system-prompt.expected.md b/snapshots/web/official-subagent-bundle/system-prompt.expected.md index 87697dd632..c58ca24e06 100644 --- a/snapshots/web/official-subagent-bundle/system-prompt.expected.md +++ b/snapshots/web/official-subagent-bundle/system-prompt.expected.md @@ -154,7 +154,7 @@ interface ToolArgsMap { } & Record; /** List your entire subagent tree: the root agent and all reachable continuable descendants, including yourself. Rows carry ids, descriptions, and status; descendant rows carry parent ids and depth from the root. You can message any other agent in the subagent tree listed as running or inactive. running means it is working; inactive means no turn is executing; it does not indicate task completion, success, or failure. While you remain active, you will be notified when a direct child finishes; there is no need to keep checking its status. Use send_message to continue the conversation. */ list_agents: Record; - /** Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings. */ + /** Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings. */ list_subagent_models: { /** Registered LLM provider id. */ provider?: string; @@ -241,7 +241,7 @@ interface ToolArgsMap { /** The exact skill name from the available skills list. */ name: string; } & Record; - /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged. */ + /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values. */ subagent: { /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */ cwd?: string; @@ -249,11 +249,11 @@ interface ToolArgsMap { description: string; /** The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs. */ prompt: string; - /** Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route. */ + /** Child LLM provider id; requires `model`. */ provider?: string; /** Model id within that provider; requires `provider`. */ model?: string; - /** Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort. */ + /** Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route. */ reasoning_effort?: string; } & Record; /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. This backend does not accept follow-up messages. */ diff --git a/snapshots/web/optional-string-editor/system-prompt.expected.md b/snapshots/web/optional-string-editor/system-prompt.expected.md index 9861eadd2e..e006a28bdd 100644 --- a/snapshots/web/optional-string-editor/system-prompt.expected.md +++ b/snapshots/web/optional-string-editor/system-prompt.expected.md @@ -154,7 +154,7 @@ interface ToolArgsMap { } & Record; /** List your entire subagent tree: the root agent and all reachable continuable descendants, including yourself. Rows carry ids, descriptions, and status; descendant rows carry parent ids and depth from the root. You can message any other agent in the subagent tree listed as running or inactive. running means it is working; inactive means no turn is executing; it does not indicate task completion, success, or failure. While you remain active, you will be notified when a direct child finishes; there is no need to keep checking its status. Use send_message to continue the conversation. */ list_agents: Record; - /** Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings. */ + /** Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings. */ list_subagent_models: { /** Registered LLM provider id. */ provider?: string; @@ -258,7 +258,7 @@ interface ToolArgsMap { /** Optional parameter of `view` command when `path` points to a file. If omitted or null, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file. */ view_range?: number[] | null; } & Record; - /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged. */ + /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values. */ subagent: { /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */ cwd?: string; @@ -266,11 +266,11 @@ interface ToolArgsMap { description: string; /** The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs. */ prompt: string; - /** Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route. */ + /** Child LLM provider id; requires `model`. */ provider?: string; /** Model id within that provider; requires `provider`. */ model?: string; - /** Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort. */ + /** Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route. */ reasoning_effort?: string; } & Record; /** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */ diff --git a/snapshots/web/plugin-recommendations/tool-schemas.expected.json b/snapshots/web/plugin-recommendations/tool-schemas.expected.json index fbb392d6cc..bfcd5cbc2e 100644 --- a/snapshots/web/plugin-recommendations/tool-schemas.expected.json +++ b/snapshots/web/plugin-recommendations/tool-schemas.expected.json @@ -328,7 +328,7 @@ }, { "name": "list_subagent_models", - "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings.", + "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.", "parameters": { "type": "object", "properties": { @@ -643,7 +643,7 @@ }, { "name": "subagent", - "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged.", + "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values.", "parameters": { "type": "object", "properties": { @@ -661,7 +661,7 @@ }, "provider": { "type": "string", - "description": "Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route." + "description": "Child LLM provider id; requires `model`." }, "model": { "type": "string", @@ -669,7 +669,7 @@ }, "reasoning_effort": { "type": "string", - "description": "Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort." + "description": "Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route." } }, "required": [ @@ -1290,7 +1290,7 @@ }, { "name": "list_subagent_models", - "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings.", + "description": "Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.", "parameters": { "type": "object", "properties": { @@ -1637,7 +1637,7 @@ }, { "name": "subagent", - "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged.", + "description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values.", "parameters": { "type": "object", "properties": { @@ -1655,7 +1655,7 @@ }, "provider": { "type": "string", - "description": "Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route." + "description": "Child LLM provider id; requires `model`." }, "model": { "type": "string", @@ -1663,7 +1663,7 @@ }, "reasoning_effort": { "type": "string", - "description": "Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort." + "description": "Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route." } }, "required": [ diff --git a/snapshots/web/ptc-round/system-prompt.expected.md b/snapshots/web/ptc-round/system-prompt.expected.md index 2f07c4d34d..34cff480f2 100644 --- a/snapshots/web/ptc-round/system-prompt.expected.md +++ b/snapshots/web/ptc-round/system-prompt.expected.md @@ -154,7 +154,7 @@ interface ToolArgsMap { } & Record; /** List your entire subagent tree: the root agent and all reachable continuable descendants, including yourself. Rows carry ids, descriptions, and status; descendant rows carry parent ids and depth from the root. You can message any other agent in the subagent tree listed as running or inactive. running means it is working; inactive means no turn is executing; it does not indicate task completion, success, or failure. While you remain active, you will be notified when a direct child finishes; there is no need to keep checking its status. Use send_message to continue the conversation. */ list_agents: Record; - /** Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit `provider`, `model`, and `reasoning_effort` when delegating to use the default child route. Omit optional fields rather than sending empty strings. */ + /** Inspect the subagent routes this Session authorizes. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings. */ list_subagent_models: { /** Registered LLM provider id. */ provider?: string; @@ -241,7 +241,7 @@ interface ToolArgsMap { /** The exact skill name from the available skills list. */ name: string; } & Record; - /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Supply `provider` and `model` together. Omit all three selection fields to use child defaults, falling back to compatible parent values. An explicit route without `reasoning_effort` uses that model's default effort, even when the route is unchanged. */ + /** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values. */ subagent: { /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */ cwd?: string; @@ -249,11 +249,11 @@ interface ToolArgsMap { description: string; /** The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs. */ prompt: string; - /** Child LLM provider id; omit together with `model` and `reasoning_effort` to use the default child route. */ + /** Child LLM provider id; requires `model`. */ provider?: string; /** Model id within that provider; requires `provider`. */ model?: string; - /** Reasoning effort for the selected model; requires `provider` and `model`. Omit to use that model's default effort. */ + /** Reasoning effort id; requires `provider` and `model`. Omit to use the selected model's default, even when it matches the parent or configured route. */ reasoning_effort?: string; } & Record; /** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */