refactor(agent): require complete send options

This commit is contained in:
_Kerman
2026-07-24 16:23:20 +08:00
parent 45fc7fda3d
commit e23960b8ad
15 changed files with 116 additions and 62 deletions
@@ -53,7 +53,11 @@ describe('inbox acceptance', () => {
agent.send([{ type: 'text', text: 'first', bad: 1n } as never])
}).toThrow(/losslessly JSON-serializable/)
expect(() => {
agent.send([{ type: 'text', text: 'first' }], { source: { kind: 'plugin', plugin: 'p', bad: 1n } as never })
agent.send([{ type: 'text', text: 'first' }], {
target: 'next-turn',
wakeup: true,
source: { kind: 'plugin', plugin: 'p', bad: 1n } as never,
})
}).toThrow(/losslessly JSON-serializable/)
expect(queued).toBe(0)
expect(agent.session.events).toHaveLength(0)