fix(subagent): use Job wording in background ack

This commit is contained in:
pku-xht
2026-08-13 16:09:53 +08:00
parent e51a8117d9
commit dff9462bea
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -359,7 +359,7 @@ export function apply(ctx: Context, config: Config): void {
render: (_args, value) => [{
type: 'text',
text: value.kind === 'background'
? `started background subagent task ${value.jobId}`
? `started background subagent job ${value.jobId}`
: value.kind === 'continuable'
? `started subagent ${value.subagentId}`
: outputValueText(value.output),
@@ -818,7 +818,7 @@ describe('dsh-tool-subagent background mode', () => {
agent: parent,
})
expect(text(started)).toBe('started background subagent task subagent-1')
expect(text(started)).toBe('started background subagent job subagent-1')
expect(prepareCalls).toBe(0)
})
@@ -830,7 +830,7 @@ describe('dsh-tool-subagent background mode', () => {
expect(start.isError).toBe(false)
if (start.isError) throw new Error('expected background subagent success')
expect(start.value).toEqual({ kind: 'background', jobId: 'subagent-1' })
expect(text(start)).toBe('started background subagent task subagent-1')
expect(text(start)).toBe('started background subagent job subagent-1')
const collected = await ctx.tools.execute({
signal: testToolSignal,
@@ -891,7 +891,7 @@ describe('dsh-tool-subagent background mode', () => {
arguments: { description: 'broken', prompt: 'p', run_in_background: true },
agent: parent,
})
expect(text(started)).toBe('started background subagent task subagent-1')
expect(text(started)).toBe('started background subagent job subagent-1')
const output = await ctx.tools.execute({
signal: testToolSignal,
callId: CallId('broken-output'),
@@ -1012,8 +1012,8 @@ describe('dsh-tool-subagent background mode', () => {
const startOne = await ctx.tools.execute({ signal: testToolSignal, callId: CallId('h1'), name: 'subagent_hang', arguments: { description: 'one', prompt: 'p', run_in_background: true }, agent: parent })
const startTwo = await ctx.tools.execute({ signal: testToolSignal, callId: CallId('h2'), name: 'subagent_hang', arguments: { description: 'two', prompt: 'p', run_in_background: true }, agent: parent })
expect(text(startOne)).toBe('started background subagent task subagent-1')
expect(text(startTwo)).toBe('started background subagent task subagent-2')
expect(text(startOne)).toBe('started background subagent job subagent-1')
expect(text(startTwo)).toBe('started background subagent job subagent-2')
const withReason = await ctx.tools.execute({ signal: testToolSignal, callId: CallId('k1'), name: 'job_kill', arguments: { job_id: 'subagent-1', reason: 'superseded' }, agent: parent })
const withoutReason = await ctx.tools.execute({ signal: testToolSignal, callId: CallId('k2'), name: 'job_kill', arguments: { job_id: 'subagent-2' }, agent: parent })