fix(subagent): resolve DSH defaults before preflight

This commit is contained in:
pku-xht
2026-08-24 21:38:28 +08:00
parent 54e908df52
commit 3c79979d1d
26 changed files with 107 additions and 59 deletions
@@ -19,10 +19,8 @@
profile: sdk
patches: !!js JSON.parse(process.env.DSH_TEST_CHILD_PATCHES ?? '[]')
dshHome: !!js process.env.DSH_TEST_CHILD_HOME
# These defaults are intentionally unavailable in the child composition;
# the model-selected route must replace them before initialize.
provider: unavailable-default
model: unavailable-default
provider: mock
model: mock-routed
env:
DSH_TELEMETRY_DISABLED: '1'
@@ -29,12 +29,13 @@ class MockDelegatingAdapter extends LlmAdapter {
.join('') ?? ''
if (toolResultText.length === 0) {
const selectedRoute = process.env.DSH_TEST_CHILD_DEFAULT_ROUTE === '1'
? { reasoning_effort: 'max' }
: { provider: 'mock', model: 'mock-routed', reasoning_effort: 'max' }
const args = JSON.stringify({
description: 'route probe',
prompt: 'report your route and workspace',
provider: 'mock',
model: 'mock-routed',
reasoning_effort: 'max',
...selectedRoute,
})
yield { type: 'block-start', index: 0, blockType: 'tool-call' }
yield { type: 'tool-call-delta', index: 0, id: CallId('call-delegate'), name: 'subagent', argumentsDelta: args }