fix(headless): align the one-shot runner with the direct rosterless profile

The shipped headless profile is base + headless (the direct-core front
door), and its installation-owned migration rewrites the old three-bundle
tuple down to that template, so a one-shot run composes no preset roster.
The runner's optional preset composition was compensating in the wrong
direction: it re-added roster reads the shipped profile never satisfies,
and its golden pinned a header field only a roster-bearing deployment
produces. The runner, the headless bundle manifest, and the dsh-run golden
return to the direct shape; skills in a direct run flow through the base
host rows' global layer, which is what the repository-plugin e2e proves.
This commit is contained in:
Yichen Jiang
2026-08-09 23:12:29 +08:00
parent 7dcefeda50
commit d5af34b022
5 changed files with 4 additions and 25 deletions

View File

@@ -38,7 +38,6 @@
"peerDependencies": {
"@deepseek-ai/dsh-agent": "^0.0.1",
"@deepseek-ai/dsh-agent-default-model": "^0.0.1",
"@deepseek-ai/dsh-agent-presets": "^0.0.1",
"@deepseek-ai/dsh-invariants": "^0.0.1",
"@deepseek-ai/dsh-llm": "^0.0.1",
"@deepseek-ai/dsh-session": "^0.0.1",
@@ -48,7 +47,6 @@
"@cordisjs/plugin-loader": "workspace:^",
"@deepseek-ai/dsh-agent": "workspace:^",
"@deepseek-ai/dsh-agent-default-model": "workspace:^",
"@deepseek-ai/dsh-agent-presets": "workspace:^",
"@deepseek-ai/dsh-invariants": "workspace:^",
"@deepseek-ai/dsh-llm": "workspace:^",
"@deepseek-ai/dsh-session": "workspace:^",

View File

@@ -13,8 +13,6 @@ import z from 'schemastery'
import { installModelSelection } from '@deepseek-ai/dsh-agent'
import type { ModelSelectionRef } from '@deepseek-ai/dsh-agent'
import type {} from '@deepseek-ai/dsh-agent-default-model'
// Empty type import carries the agentPresets Context merge for the optional roster read.
import type {} from '@deepseek-ai/dsh-agent-presets'
import { createUserMessage } from '@deepseek-ai/dsh-llm'
import { SessionId } from '@deepseek-ai/dsh-session'
import type { SessionEvent } from '@deepseek-ai/dsh-session'
@@ -108,24 +106,13 @@ async function run(ctx: Context, task: string, io: HeadlessIo): Promise<void> {
if (agents === undefined || defaultModel === undefined || sessions === undefined) return
const selection = defaultModel.currentSelection()
// A one-shot run composes its agent from the same preset roster `dsh web`
// offers: the default preset both lands on the header (the log states what
// the agent ran) and mounts in setup, where a broken composition still
// fails the creation. A composition with no roster keeps the pre-preset
// behavior — the agent runs on the host composition alone.
const presets = ctx.get('agentPresets')
const presetId = presets === undefined ? undefined : (await presets.resolve()).id
const { agent } = await agents.create({
sessionId: SessionId(`session-${randomUUID()}`),
meta: {
cwd: process.cwd(),
...presetId === undefined ? {} : { agentPreset: presetId },
},
meta: { cwd: process.cwd() },
agentOptions: { provider: selection.provider, model: selection.model },
setup: async (agentCtx) => {
setup: (agentCtx) => {
const selected: ModelSelectionRef = { current: selection, assembled: undefined }
installModelSelection(agentCtx, selected)
if (presets !== undefined) await presets.mount(agentCtx, presetId)
},
})
await agent.whenIdle()

View File

@@ -23,14 +23,11 @@
{
"path": "../../core/agent-default-model"
},
{
"path": "../../core/session"
},
{
"path": "../../llm/llm"
},
{
"path": "../../preset/agent-presets"
"path": "../../core/session"
},
{
"path": "../../support/invariants"