feat(subagent): catalog one-shot child sessions
This commit is contained in:
@@ -280,6 +280,7 @@ export function apply(ctx: Context, config: Config): void {
|
||||
|
||||
const maxDepth = typeof config.maxDepth === 'number' ? config.maxDepth : undefined
|
||||
const request = {
|
||||
label: args.description,
|
||||
prompt: [{ type: 'text', text: args.prompt }] as ContentBlock[],
|
||||
parent,
|
||||
...config.agentOptions !== undefined ? { agentOptions: config.agentOptions } : {},
|
||||
|
||||
@@ -12,6 +12,7 @@ function fakeParent(id = 'parent-1'): Agent {
|
||||
|
||||
function baseRequest(over: Partial<SubagentStartRequest> = {}): SubagentStartRequest {
|
||||
return {
|
||||
label: 'task',
|
||||
prompt: [{ type: 'text', text: 'task' }],
|
||||
parent: fakeParent(),
|
||||
signal: new AbortController().signal,
|
||||
|
||||
@@ -1007,6 +1007,7 @@ describe('depth budget configuration', () => {
|
||||
it('defaults maxDepth to 3 and forwards it in the start request', async () => {
|
||||
const { ctx, requests } = await captureSetup()
|
||||
await callSubagent(ctx, { description: 'd', prompt: 'p' })
|
||||
expect(requests[0]?.label).toBe('d')
|
||||
expect(requests[0]?.maxDepth).toBe(3)
|
||||
expect(requests[0]?.toolFilter).toBeUndefined()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user