feat(sdk): expose active sessions
This commit is contained in:
parent
28a00ad6af
commit
8a5231ec26
18 changed files with 186 additions and 68 deletions
|
|
@ -33,6 +33,7 @@ test("embedded client uses the real router and handlers", async () => {
|
|||
yield* opencode.sessions.switchModel({ sessionID, model })
|
||||
const selected = yield* opencode.sessions.get({ sessionID })
|
||||
const page = yield* opencode.sessions.list({ directory: AbsolutePath.make(directory) })
|
||||
const active = yield* opencode.sessions.active()
|
||||
const admitted = yield* opencode.sessions.prompt({
|
||||
sessionID,
|
||||
prompt: Prompt.make({ text: "Do not run" }),
|
||||
|
|
@ -70,6 +71,7 @@ test("embedded client uses the real router and handlers", async () => {
|
|||
expect(selected.model?.id).toBe(model.id)
|
||||
expect(selected.model?.providerID).toBe(model.providerID)
|
||||
expect(page.data.some((session) => session.id === sessionID)).toBe(true)
|
||||
expect(active).toEqual({})
|
||||
expect(admitted.sessionID).toBe(sessionID)
|
||||
expect(context.some((message) => message.type === "model-switched")).toBe(true)
|
||||
expect(event).toMatchObject({ type: "session.next.model.switched", durable: { seq: 1 } })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue