This commit is contained in:
imccyu
2026-08-25 06:19:23 +08:00
parent 1229292497
commit 059598de59
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ export class SessionController extends TypertRemoteService {
ctx.effect(() => async () => {
await Promise.allSettled([...this.promotions])
}, 'session-controller.promotions')
this.history = new SessionHistoryController(ctx, observation => { this.promote(observation) })
this.history = new SessionHistoryController(ctx, (observation) => { this.promote(observation) })
this.listState = new ApiSessionList(
ctx,
config.coldBlankProbeMaxBytes ?? DEFAULT_COLD_BLANK_PROBE_MAX_BYTES,
@@ -168,10 +168,10 @@ describe('SessionController facade', () => {
}) as never)
const controller = createSessionTestController(ctx, defaults)
const agents = (controller as unknown as { agents: ApiSessionAgentController }).agents
const started = Promise.withResolvers<void>()
const release = Promise.withResolvers<void>()
const started = Promise.withResolvers<undefined>()
const release = Promise.withResolvers<undefined>()
vi.spyOn(agents, 'resolveObservedAgent').mockImplementation(async () => {
started.resolve()
started.resolve(undefined)
await release.promise
return {
agent: { id: sessionId, session: { id: sessionId }, ctx, status: 'idle' } as unknown as Agent,
@@ -189,7 +189,7 @@ describe('SessionController facade', () => {
await Promise.resolve()
expect(disposed).toBe(false)
release.resolve()
release.resolve(undefined)
await disposal
await expect(waiting).resolves.toMatchObject({ done: true })
})