chore: generate

This commit is contained in:
opencode-agent[bot]
2026-05-31 01:09:55 +00:00
parent 7f571d36ea
commit 102c8353e0
71 changed files with 11252 additions and 8889 deletions

View File

@@ -247,7 +247,12 @@ const env = Layer.mergeAll(
const it = testEffect(env)
const compactionEnv = Layer.mergeAll(SessionNs.defaultLayer, Database.defaultLayer, EventV2Bridge.defaultLayer, CrossSpawnSpawner.defaultLayer)
const compactionEnv = Layer.mergeAll(
SessionNs.defaultLayer,
Database.defaultLayer,
EventV2Bridge.defaultLayer,
CrossSpawnSpawner.defaultLayer,
)
const itCompaction = testEffect(compactionEnv)
type CompactionProcessOptions = {
@@ -587,7 +592,6 @@ describe("session.compaction.create", () => {
auto: true,
overflow: true,
})
}),
),
)
@@ -852,7 +856,8 @@ describe("session.compaction.process", () => {
let seen = false
const unsub = yield* events.listen((evt) => {
if (evt.type !== SessionCompaction.Event.Compacted.type) return Effect.void
if ((evt.data as typeof SessionCompaction.Event.Compacted.data.Type).sessionID !== session.id) return Effect.void
if ((evt.data as typeof SessionCompaction.Event.Compacted.data.Type).sessionID !== session.id)
return Effect.void
seen = true
Deferred.doneUnsafe(done, Effect.void)
return Effect.void

View File

@@ -1617,7 +1617,10 @@ describe("session.llm.stream", () => {
]
const request = waitRequest("/messages", createEventResponse(chunks))
const resolved = yield* Provider.use.getModel(ProviderV2.ID.make("anthropic"), ProviderV2.ModelID.make(model.id))
const resolved = yield* Provider.use.getModel(
ProviderV2.ID.make("anthropic"),
ProviderV2.ModelID.make(model.id),
)
const sessionID = SessionID.make("session-test-anthropic-tools")
const agent = {
name: "test",
@@ -1816,7 +1819,10 @@ describe("session.llm.stream", () => {
]
const request = waitRequest(pathSuffix, createEventResponse(chunks))
const resolved = yield* Provider.use.getModel(ProviderV2.ID.make(geminiFixture.providerID), ProviderV2.ModelID.make(model.id))
const resolved = yield* Provider.use.getModel(
ProviderV2.ID.make(geminiFixture.providerID),
ProviderV2.ModelID.make(model.id),
)
const sessionID = SessionID.make("session-test-4")
const agent = {
name: "test",

View File

@@ -991,7 +991,9 @@ describe("session.message-v2.toModelMessage", () => {
const assistantID1 = "m-assistant-1"
const assistantID2 = "m-assistant-2"
const aborted = new SessionLegacy.AbortedError({ message: "aborted" }).toObject() as SessionLegacy.Assistant["error"]
const aborted = new SessionLegacy.AbortedError({
message: "aborted",
}).toObject() as SessionLegacy.Assistant["error"]
const input: SessionLegacy.WithParts[] = [
{

View File

@@ -539,7 +539,12 @@ noLLMServer.instance.skip(
Effect.provide(SessionV2.defaultLayer),
)
const { db } = yield* Database.Service
const row = yield* db.select().from(SessionMessageTable).where(eq(SessionMessageTable.session_id, chat.id)).get().pipe(Effect.orDie)
const row = yield* db
.select()
.from(SessionMessageTable)
.where(eq(SessionMessageTable.session_id, chat.id))
.get()
.pipe(Effect.orDie)
expect(messages.find((message) => message.type === "user")).toMatchObject({ type: "user", text: "hello v2" })
expect(typeof row?.data.time.created).toBe("number")
expect(messages).toEqual(

View File

@@ -87,31 +87,31 @@ describe("session.retry.delay", () => {
it.instance("policy updates retry status and increments attempts", () =>
Effect.gen(function* () {
const sessionID = SessionID.make("session-retry-test")
const error = apiError({ "retry-after-ms": "0" })
const status = yield* SessionStatus.Service
const sessionID = SessionID.make("session-retry-test")
const error = apiError({ "retry-after-ms": "0" })
const status = yield* SessionStatus.Service
const step = yield* Schedule.toStepWithMetadata(
SessionRetry.policy({
provider: "test",
parse: Schema.decodeUnknownSync(SessionLegacy.APIError.Schema),
set: (info) =>
status.set(sessionID, {
type: "retry",
attempt: info.attempt,
message: info.message,
next: info.next,
}),
}),
)
yield* step(error)
yield* step(error)
const step = yield* Schedule.toStepWithMetadata(
SessionRetry.policy({
provider: "test",
parse: Schema.decodeUnknownSync(SessionLegacy.APIError.Schema),
set: (info) =>
status.set(sessionID, {
type: "retry",
attempt: info.attempt,
message: info.message,
next: info.next,
}),
}),
)
yield* step(error)
yield* step(error)
expect(yield* status.get(sessionID)).toMatchObject({
type: "retry",
attempt: 2,
message: "boom",
})
expect(yield* status.get(sessionID)).toMatchObject({
type: "retry",
attempt: 2,
message: "boom",
})
}),
)
})

View File

@@ -49,7 +49,10 @@ describe("session.created event", () => {
const unsub = yield* events.listen((event) => {
if (event.type === SessionNs.Event.Created.type)
Deferred.doneUnsafe(received, Effect.succeed((event.data as typeof SessionNs.Event.Created.data.Type).info as SessionNs.Info))
Deferred.doneUnsafe(
received,
Effect.succeed((event.data as typeof SessionNs.Event.Created.data.Type).info as SessionNs.Info),
)
return Effect.void
})
yield* Effect.addFinalizer(() => unsub)
@@ -127,7 +130,10 @@ describe("step-finish token propagation via event", () => {
const received = yield* Deferred.make<SessionLegacy.Part>()
const unsub = yield* events.listen((event) => {
if (event.type === MessageV2.Event.PartUpdated.type)
Deferred.doneUnsafe(received, Effect.succeed((event.data as typeof MessageV2.Event.PartUpdated.data.Type).part as SessionLegacy.Part))
Deferred.doneUnsafe(
received,
Effect.succeed((event.data as typeof MessageV2.Event.PartUpdated.data.Type).part as SessionLegacy.Part),
)
return Effect.void
})
yield* Effect.addFinalizer(() => unsub)