refactor(agent): address inbox mutations by message id
This commit is contained in:
@@ -70,7 +70,7 @@ describe('Agent', () => {
|
||||
source: { kind: 'plugin', plugin: 'test' },
|
||||
})
|
||||
agent.inject(context)
|
||||
agent.inbox.remove('next-step', context.id)
|
||||
agent.inbox.remove(context.id)
|
||||
const prompt = createUserMessage({ content: [{ type: 'text', text: 'run' }], source: { kind: 'user' } })
|
||||
agent.followup(prompt)
|
||||
await agent.whenIdle()
|
||||
|
||||
@@ -194,7 +194,7 @@ describe('abort during tool execution ends the turn', () => {
|
||||
send(agent, 'go')
|
||||
// The wake microtask has not run yet: remove the only pending message so
|
||||
// the admission batch is empty.
|
||||
agent.inbox.remove('next-turn', agent.inbox.nextTurn[0]!.id)
|
||||
agent.inbox.remove(agent.inbox.nextTurn[0]!.id)
|
||||
await waitForIdle(ctx, agent)
|
||||
expect(adapter.requests).toHaveLength(0)
|
||||
expect(agent.session.events.some(event => event.type === 'turn/start')).toBe(false)
|
||||
|
||||
Reference in New Issue
Block a user