refactor(agent): unify sourced message delivery

This commit is contained in:
_Kerman
2026-07-24 22:38:50 +08:00
parent 009d113e0e
commit 992cf894af
197 changed files with 1890 additions and 2132 deletions
@@ -106,7 +106,7 @@ describe('dsh-subagent-spawn', () => {
it('a fresh child does NOT inherit the parent conversation (its log starts empty before the prompt)', async () => {
// Drive the parent through one real turn so it has history, THEN spawn.
const { ctx, parent } = await setup([textResponse('parent turn'), textResponse('child sees nothing')])
parent.followup([{ type: 'text', text: 'parent prompt' }])
parent.followup({ content: [{ type: 'text', text: 'parent prompt' }], source: { kind: 'user' } })
await parent.whenIdle()
const parentEventCount = parent.session.events.length
expect(parentEventCount).toBeGreaterThan(0)
@@ -383,7 +383,7 @@ describe('dsh-subagent-spawn', () => {
textResponse('parent answer'),
textResponse('child answer'),
])
parent.followup([{ type: 'text', text: 'hi' }])
parent.followup({ content: [{ type: 'text', text: 'hi' }], source: { kind: 'user' } })
await parent.whenIdle()
const run = await start(ctx, 'spawn', {