chore: generate
This commit is contained in:
@@ -107,7 +107,11 @@ test("sync v2 settles pending tools when a live failure arrives", async () => {
|
||||
|
||||
await wait(() => {
|
||||
const assistant = sync.session.message.fromSession("session-1")[0]
|
||||
return assistant?.type === "assistant" && assistant.content[0]?.type === "tool" && assistant.content[0].state.status === "error"
|
||||
return (
|
||||
assistant?.type === "assistant" &&
|
||||
assistant.content[0]?.type === "tool" &&
|
||||
assistant.content[0].state.status === "error"
|
||||
)
|
||||
})
|
||||
|
||||
const assistant = sync.session.message.fromSession("session-1")[0]
|
||||
|
||||
@@ -47,7 +47,7 @@ const appCache: Partial<Record<string, CachedApp>> = {}
|
||||
export async function disposeApps() {
|
||||
const apps = Object.values(appCache)
|
||||
for (const key of Object.keys(appCache)) delete appCache[key]
|
||||
await Promise.all(apps.flatMap((app) => app === undefined ? [] : [app.dispose()]))
|
||||
await Promise.all(apps.flatMap((app) => (app === undefined ? [] : [app.dispose()])))
|
||||
}
|
||||
|
||||
function app(modules: Runtime, options: CallOptions) {
|
||||
|
||||
@@ -493,10 +493,12 @@ describe("session HttpApi", () => {
|
||||
direction: "next",
|
||||
})
|
||||
|
||||
const nextMessagePage = yield* request(`/api/session/${session.id}/message?cursor=${messageCursor}`, { headers })
|
||||
expect((yield* json<{ items: SessionMessage.Message[] }>(nextMessagePage)).items.map((message) => message.id)).toEqual([
|
||||
firstMessage.id,
|
||||
])
|
||||
const nextMessagePage = yield* request(`/api/session/${session.id}/message?cursor=${messageCursor}`, {
|
||||
headers,
|
||||
})
|
||||
expect(
|
||||
(yield* json<{ items: SessionMessage.Message[] }>(nextMessagePage)).items.map((message) => message.id),
|
||||
).toEqual([firstMessage.id])
|
||||
|
||||
const legacyMessageCursor = Buffer.from(
|
||||
JSON.stringify({ id: secondMessage.id, time: 1, order: "desc", direction: "next" }),
|
||||
@@ -504,9 +506,9 @@ describe("session HttpApi", () => {
|
||||
const legacyMessagePage = yield* request(`/api/session/${session.id}/message?cursor=${legacyMessageCursor}`, {
|
||||
headers,
|
||||
})
|
||||
expect((yield* json<{ items: SessionMessage.Message[] }>(legacyMessagePage)).items.map((message) => message.id)).toEqual([
|
||||
firstMessage.id,
|
||||
])
|
||||
expect(
|
||||
(yield* json<{ items: SessionMessage.Message[] }>(legacyMessagePage)).items.map((message) => message.id),
|
||||
).toEqual([firstMessage.id])
|
||||
|
||||
const messageCursorWithOrder = yield* request(
|
||||
`/api/session/${session.id}/message?cursor=${messageCursor}&order=asc`,
|
||||
|
||||
@@ -280,20 +280,18 @@ function recordedNativeLLMLayer(scenario: RecordedScenario) {
|
||||
)
|
||||
// Only the HTTP client is recorded; RequestExecutor and the opencode LLM stack remain real.
|
||||
const recordedHttp = HttpRecorder.cassetteLayer(scenario.cassette, {
|
||||
directory: FIXTURES_DIR,
|
||||
mode: shouldRecord ? "record" : "replay",
|
||||
metadata: {
|
||||
provider: scenario.providerID,
|
||||
protocol: scenario.protocol,
|
||||
route: scenario.protocol,
|
||||
tags: scenario.tags,
|
||||
},
|
||||
redactor: recordingRedactor,
|
||||
})
|
||||
directory: FIXTURES_DIR,
|
||||
mode: shouldRecord ? "record" : "replay",
|
||||
metadata: {
|
||||
provider: scenario.providerID,
|
||||
protocol: scenario.protocol,
|
||||
route: scenario.protocol,
|
||||
tags: scenario.tags,
|
||||
},
|
||||
redactor: recordingRedactor,
|
||||
})
|
||||
const recordedClient = LLMClient.layer.pipe(
|
||||
Layer.provide(
|
||||
Layer.mergeAll(RequestExecutor.layer.pipe(Layer.provide(recordedHttp)), WebSocketExecutor.layer),
|
||||
),
|
||||
Layer.provide(Layer.mergeAll(RequestExecutor.layer.pipe(Layer.provide(recordedHttp)), WebSocketExecutor.layer)),
|
||||
)
|
||||
|
||||
return Layer.mergeAll(
|
||||
|
||||
@@ -1004,7 +1004,8 @@ itProviderError.live("session.processor effect tests fail provider-executed erro
|
||||
const mdl = yield* provider.getModel(ref.providerID, ref.modelID)
|
||||
const settlements: Array<typeof SessionEvent.Tool.Failed.Type> = []
|
||||
const off = yield* events.listen((event) => {
|
||||
if (event.type === SessionEvent.Tool.Failed.type) settlements.push(event as typeof SessionEvent.Tool.Failed.Type)
|
||||
if (event.type === SessionEvent.Tool.Failed.type)
|
||||
settlements.push(event as typeof SessionEvent.Tool.Failed.Type)
|
||||
return Effect.void
|
||||
})
|
||||
const handle = yield* processors.create({ assistantMessage: msg, sessionID: chat.id, model: mdl })
|
||||
@@ -1059,7 +1060,8 @@ itFragmentFailure.live("session.processor effect tests flush partial v2 fragment
|
||||
let reasoning: string | undefined
|
||||
const off = yield* events.listen((event) => {
|
||||
seen.push(event.type)
|
||||
if (event.type === SessionEvent.Text.Ended.type) text = (event.data as typeof SessionEvent.Text.Ended.data.Type).text
|
||||
if (event.type === SessionEvent.Text.Ended.type)
|
||||
text = (event.data as typeof SessionEvent.Text.Ended.data.Type).text
|
||||
if (event.type === SessionEvent.Reasoning.Ended.type)
|
||||
reasoning = (event.data as typeof SessionEvent.Reasoning.Ended.data.Type).text
|
||||
return Effect.void
|
||||
|
||||
Reference in New Issue
Block a user