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:
@@ -1,4 +1,4 @@
|
|||||||
{"type":"session","version":0,"id":"{{sessionId}}","createdAt":0,"cwd":"{{cwd}}","delegationDepth":0,"agentPreset":"standard"}
|
{"type":"session","version":0,"id":"{{sessionId}}","createdAt":0,"cwd":"{{cwd}}","delegationDepth":0}
|
||||||
{"type":"permission/preset","seq":0,"time":0,"data":{"preset":"danger-full-access"}}
|
{"type":"permission/preset","seq":0,"time":0,"data":{"preset":"danger-full-access"}}
|
||||||
{"type":"sandbox/mode","seq":1,"time":0,"data":{"mode":"danger-full-access"}}
|
{"type":"sandbox/mode","seq":1,"time":0,"data":{"mode":"danger-full-access"}}
|
||||||
{"type":"approval/policy","seq":2,"time":0,"data":{"policy":"never"}}
|
{"type":"approval/policy","seq":2,"time":0,"data":{"policy":"never"}}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "^0.0.1",
|
"@deepseek-ai/dsh-agent": "^0.0.1",
|
||||||
"@deepseek-ai/dsh-agent-default-model": "^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-invariants": "^0.0.1",
|
||||||
"@deepseek-ai/dsh-llm": "^0.0.1",
|
"@deepseek-ai/dsh-llm": "^0.0.1",
|
||||||
"@deepseek-ai/dsh-session": "^0.0.1",
|
"@deepseek-ai/dsh-session": "^0.0.1",
|
||||||
@@ -48,7 +47,6 @@
|
|||||||
"@cordisjs/plugin-loader": "workspace:^",
|
"@cordisjs/plugin-loader": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-default-model": "workspace:^",
|
"@deepseek-ai/dsh-agent-default-model": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-presets": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import z from 'schemastery'
|
|||||||
import { installModelSelection } from '@deepseek-ai/dsh-agent'
|
import { installModelSelection } from '@deepseek-ai/dsh-agent'
|
||||||
import type { ModelSelectionRef } from '@deepseek-ai/dsh-agent'
|
import type { ModelSelectionRef } from '@deepseek-ai/dsh-agent'
|
||||||
import type {} from '@deepseek-ai/dsh-agent-default-model'
|
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 { createUserMessage } from '@deepseek-ai/dsh-llm'
|
||||||
import { SessionId } from '@deepseek-ai/dsh-session'
|
import { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import type { SessionEvent } 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
|
if (agents === undefined || defaultModel === undefined || sessions === undefined) return
|
||||||
|
|
||||||
const selection = defaultModel.currentSelection()
|
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({
|
const { agent } = await agents.create({
|
||||||
sessionId: SessionId(`session-${randomUUID()}`),
|
sessionId: SessionId(`session-${randomUUID()}`),
|
||||||
meta: {
|
meta: { cwd: process.cwd() },
|
||||||
cwd: process.cwd(),
|
|
||||||
...presetId === undefined ? {} : { agentPreset: presetId },
|
|
||||||
},
|
|
||||||
agentOptions: { provider: selection.provider, model: selection.model },
|
agentOptions: { provider: selection.provider, model: selection.model },
|
||||||
setup: async (agentCtx) => {
|
setup: (agentCtx) => {
|
||||||
const selected: ModelSelectionRef = { current: selection, assembled: undefined }
|
const selected: ModelSelectionRef = { current: selection, assembled: undefined }
|
||||||
installModelSelection(agentCtx, selected)
|
installModelSelection(agentCtx, selected)
|
||||||
if (presets !== undefined) await presets.mount(agentCtx, presetId)
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
await agent.whenIdle()
|
await agent.whenIdle()
|
||||||
|
|||||||
@@ -23,14 +23,11 @@
|
|||||||
{
|
{
|
||||||
"path": "../../core/agent-default-model"
|
"path": "../../core/agent-default-model"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "../../core/session"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "../../llm/llm"
|
"path": "../../llm/llm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "../../preset/agent-presets"
|
"path": "../../core/session"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "../../support/invariants"
|
"path": "../../support/invariants"
|
||||||
|
|||||||
Generated
-3
@@ -1342,9 +1342,6 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-default-model':
|
'@deepseek-ai/dsh-agent-default-model':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-default-model
|
version: link:../../core/agent-default-model
|
||||||
'@deepseek-ai/dsh-agent-presets':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../preset/agent-presets
|
|
||||||
'@deepseek-ai/dsh-invariants':
|
'@deepseek-ai/dsh-invariants':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../support/invariants
|
version: link:../../support/invariants
|
||||||
|
|||||||
Reference in New Issue
Block a user