Browse Source

test: trim unrelated inbox changes

_Kerman 1 month ago
parent
commit
90b7ac94e2

+ 0 - 16
packages/core/agent-loop/tests/loop.spec.ts

@@ -134,22 +134,6 @@ describe('agent loop', () => {
     expect(adapter.requests).toHaveLength(1)
     expect(adapter.requests).toHaveLength(1)
   })
   })
 
 
-  it('rejects overlapping maintenance work', async () => {
-    const ctx = await harness(new MockAdapter([]))
-    const agent = ctx.agentLoop.create(SessionId('overlapping-maintenance'), {
-      provider: 'mock',
-      model: 'mock',
-    })
-    const finish = Promise.withResolvers<undefined>()
-    const maintenance = agent.runMaintenance(() => finish.promise)
-
-    expect(() => agent.runMaintenance(async () => undefined))
-      .toThrow('agent "overlapping-maintenance" already has active work')
-
-    finish.resolve(undefined)
-    await maintenance
-  })
-
   it('suppresses the replay when a latched maintenance wake is removed', async () => {
   it('suppresses the replay when a latched maintenance wake is removed', async () => {
     const adapter = new MockAdapter([])
     const adapter = new MockAdapter([])
     const ctx = await harness(adapter)
     const ctx = await harness(adapter)

+ 2 - 14
packages/host/apiproxy/tests/api-proxy-jobs.spec.ts

@@ -55,20 +55,8 @@ async function harness(withRegistry: boolean): Promise<{ ctx: Context; session:
   }
   }
   const session = ctx.sessions.create()
   const session = ctx.sessions.create()
   const agent = {
   const agent = {
-    id: session.id,
-    options: {},
-    session,
-    inbox: { nextTurn: [], nextStep: [], hasPending: false } as never,
-    status: 'idle',
-    ctx,
-    send() {},
-    followup() {},
-    steer() {},
-    inject() {},
-    cancel() {},
-    runMaintenance: task => task(new AbortController().signal),
-    whenIdle: () => Promise.resolve(),
-  } satisfies Agent
+    id: session.id, session, inbox: { nextTurn: [], nextStep: [], hasPending: false }, status: 'idle', ctx,
+  } as Agent
   ctx.agents.register(agent)
   ctx.agents.register(agent)
   return { ctx, session, agent }
   return { ctx, session, agent }
 }
 }

+ 2 - 12
packages/host/apiproxy/tests/api-proxy-projections.spec.ts

@@ -67,25 +67,15 @@ async function harness(withRegistry: boolean): Promise<{ ctx: Context; session:
   await ctx.plugin(SessionStore)
   await ctx.plugin(SessionStore)
   await ctx.plugin(UserQuestionService)
   await ctx.plugin(UserQuestionService)
   await ctx.plugin(AgentRegistry)
   await ctx.plugin(AgentRegistry)
-  if (withRegistry) {
-    await ctx.plugin(SessionProjectionRegistry)
-  }
+  if (withRegistry) await ctx.plugin(SessionProjectionRegistry)
   const session = ctx.sessions.create()
   const session = ctx.sessions.create()
   const agent = {
   const agent = {
     id: session.id,
     id: session.id,
-    options: {},
     session,
     session,
     inbox: { nextTurn: [], nextStep: [], hasPending: false } as never,
     inbox: { nextTurn: [], nextStep: [], hasPending: false } as never,
     status: 'idle',
     status: 'idle',
     ctx,
     ctx,
-    send() {},
-    followup() {},
-    steer() {},
-    inject() {},
-    cancel() {},
-    runMaintenance: task => task(new AbortController().signal),
-    whenIdle: () => Promise.resolve(),
-  } satisfies Agent
+  } as Agent
   if (withRegistry) Object.assign(agent, { inbox: new Inbox(ctx, agent.session, agentEvents(ctx, agent)) })
   if (withRegistry) Object.assign(agent, { inbox: new Inbox(ctx, agent.session, agentEvents(ctx, agent)) })
   ctx.agents.register(agent)
   ctx.agents.register(agent)
   return { ctx, session }
   return { ctx, session }