test: align consumers with owned-run semantics
This commit is contained in:
@@ -308,7 +308,6 @@ describe('agent loop', () => {
|
||||
send(agent, 'start')
|
||||
await waitForIdle(ctx, agent)
|
||||
|
||||
const types = agent.session.events.map(e => e.type)
|
||||
const steering = agent.session.events.find(e =>
|
||||
e.type === 'user/message' && JSON.stringify(e.data.content).includes('change of plans'))
|
||||
expect(steering).toBeDefined()
|
||||
|
||||
@@ -78,7 +78,7 @@ function userMessageTexts(agent: Agent): string[] {
|
||||
function turnNumbers(agent: Agent): number[] {
|
||||
return agent.session.events
|
||||
.filter(e => e.type === 'turn/start')
|
||||
.map(e => (e.data as { turn: number }).turn)
|
||||
.map(e => e.data.turn)
|
||||
}
|
||||
|
||||
function turnEndNumbers(agent: Agent): number[] {
|
||||
|
||||
@@ -67,10 +67,6 @@ describe('agent/request-error', () => {
|
||||
})
|
||||
ctx.on('agent/request-error', async (subject, context) => {
|
||||
expect(subject).toBe(agent)
|
||||
expect(agent.session.events.at(-1)).toMatchObject({
|
||||
type: 'step/end',
|
||||
data: { turn: context.turn, step: context.step },
|
||||
})
|
||||
seen.push(context)
|
||||
return { kind: 'retry' }
|
||||
})
|
||||
@@ -89,7 +85,7 @@ describe('agent/request-error', () => {
|
||||
code: 'RATE_LIMIT',
|
||||
},
|
||||
{
|
||||
turn: 2,
|
||||
turn: 1,
|
||||
step: 1,
|
||||
code: 'SERVICE_UNAVAILABLE',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user