refactor(session): route construction through Session.create
This commit is contained in:
@@ -61,7 +61,7 @@ describe('SessionTitleService.rename', () => {
|
||||
const session = ctx.sessions.create(SessionId('rename-reject'))
|
||||
expect(() => ctx.sessionTitle.rename(session, ' [31m ')).toThrow(/visible characters/)
|
||||
|
||||
expect(() => ctx.sessionTitle.rename(new Session(SessionId('detached')), 'name'))
|
||||
expect(() => ctx.sessionTitle.rename(Session.create(SessionId('detached')), 'name'))
|
||||
.toThrow(/not live in this store/)
|
||||
})
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ describe('SessionTitleService configuration and refresh boundaries', () => {
|
||||
await expect(withProvider.sessionTitle.refresh(providerEmpty)).resolves.toBeUndefined()
|
||||
expect(generate).not.toHaveBeenCalled()
|
||||
|
||||
await expect(withProvider.sessionTitle.refresh(new Session(SessionId('detached'))))
|
||||
await expect(withProvider.sessionTitle.refresh(Session.create(SessionId('detached'))))
|
||||
.rejects.toThrow(/not live in this store/)
|
||||
const controller = new AbortController()
|
||||
controller.abort(new Error('already cancelled'))
|
||||
@@ -165,7 +165,7 @@ describe('SessionTitleService configuration and refresh boundaries', () => {
|
||||
|
||||
it('shares one fallback across concurrent refreshes', async () => {
|
||||
const ctx = await setup()
|
||||
const seed = new Session(SessionId('fallback-concurrency-seed'))
|
||||
const seed = Session.create(SessionId('fallback-concurrency-seed'))
|
||||
seed.append('turn/start', {
|
||||
turn: 1,
|
||||
trigger: { kind: 'message', source: { kind: 'user' } },
|
||||
|
||||
@@ -134,7 +134,7 @@ describe('SessionTitleService', () => {
|
||||
})
|
||||
|
||||
it('folds the latest title event during replay', () => {
|
||||
const seed = new Session(SessionId('source'))
|
||||
const seed = Session.create(SessionId('source'))
|
||||
seed.append('session/title', {
|
||||
title: 'Earlier',
|
||||
messageSeqs: [1],
|
||||
|
||||
Reference in New Issue
Block a user