chore: generate
parent
e4ff1ea778
commit
854484babf
|
|
@ -497,5 +497,6 @@ const rt = lazy(() => {
|
|||
return makeRuntime(ChildProcessSpawner, defaultLayer)
|
||||
})
|
||||
|
||||
export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) => rt().runPromiseExit(...(args as [any]))
|
||||
export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) =>
|
||||
rt().runPromiseExit(...(args as [any]))
|
||||
export const runPromise: ReturnType<typeof rt>["runPromise"] = (...args) => rt().runPromise(...(args as [any]))
|
||||
|
|
|
|||
|
|
@ -900,7 +900,6 @@ export namespace MessageV2 {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
export function filterCompacted(msgs: Iterable<MessageV2.WithParts>) {
|
||||
const result = [] as MessageV2.WithParts[]
|
||||
const completed = new Set<string>()
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@ function cmd(shell: string, name: string, command: string, cwd: string, env: Nod
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
async function run(
|
||||
input: {
|
||||
shell: string
|
||||
|
|
@ -340,23 +339,19 @@ async function run(
|
|||
|
||||
const exit = await CrossSpawnSpawner.runPromiseExit((spawner) =>
|
||||
Effect.gen(function* () {
|
||||
const handle = yield* spawner.spawn(
|
||||
cmd(input.shell, input.name, input.command, input.cwd, input.env),
|
||||
)
|
||||
const handle = yield* spawner.spawn(cmd(input.shell, input.name, input.command, input.cwd, input.env))
|
||||
|
||||
yield* Effect.forkScoped(
|
||||
Stream.runForEach(
|
||||
Stream.decodeText(handle.all),
|
||||
(chunk) =>
|
||||
Effect.sync(() => {
|
||||
output += chunk
|
||||
ctx.metadata({
|
||||
metadata: {
|
||||
output: preview(output),
|
||||
description: input.description,
|
||||
},
|
||||
})
|
||||
}),
|
||||
Stream.runForEach(Stream.decodeText(handle.all), (chunk) =>
|
||||
Effect.sync(() => {
|
||||
output += chunk
|
||||
ctx.metadata({
|
||||
metadata: {
|
||||
output: preview(output),
|
||||
description: input.description,
|
||||
},
|
||||
})
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -385,10 +380,7 @@ async function run(
|
|||
}
|
||||
|
||||
return exit.kind === "exit" ? exit.code : null
|
||||
}).pipe(
|
||||
Effect.scoped,
|
||||
Effect.orDie,
|
||||
),
|
||||
}).pipe(Effect.scoped, Effect.orDie),
|
||||
)
|
||||
|
||||
let code: number | null = null
|
||||
|
|
|
|||
|
|
@ -722,7 +722,10 @@ describe("MessageV2.filterCompacted", () => {
|
|||
const u1 = await addUser(session.id, "hello")
|
||||
await addCompactionPart(session.id, u1)
|
||||
|
||||
const error = new MessageV2.APIError({ message: "boom", isRetryable: true }).toObject() as MessageV2.Assistant["error"]
|
||||
const error = new MessageV2.APIError({
|
||||
message: "boom",
|
||||
isRetryable: true,
|
||||
}).toObject() as MessageV2.Assistant["error"]
|
||||
await addAssistant(session.id, u1, { summary: true, finish: "end_turn", error })
|
||||
const u2 = await addUser(session.id, "retry")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue