test(server): reproduce partial startup catalog reads
This commit is contained in:
parent
c91604d519
commit
2ca34a7e63
2 changed files with 74 additions and 0 deletions
18
packages/server/test/fixtures/delayed-catalog-plugin.ts
vendored
Normal file
18
packages/server/test/fixtures/delayed-catalog-plugin.ts
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { Plugin } from "@opencode-ai/plugin/v2/effect"
|
||||
import { Effect } from "effect"
|
||||
|
||||
export default Plugin.define({
|
||||
id: "delayed-catalog",
|
||||
effect: Effect.fn(function* (ctx) {
|
||||
yield* Effect.sleep("300 millis")
|
||||
yield* ctx.catalog.transform((catalog) => {
|
||||
catalog.provider.update("delayed-provider", (provider) => {
|
||||
provider.name = "Delayed Provider"
|
||||
})
|
||||
catalog.model.update("delayed-provider", "delayed-model", (model) => {
|
||||
model.name = "Delayed Model"
|
||||
model.enabled = true
|
||||
})
|
||||
})
|
||||
}),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue