fix(opencode): scope reference readiness wait

This commit is contained in:
Dax Raad
2026-06-23 00:10:36 -04:00
parent ed75ce9ecc
commit 6ea3e6698a
2 changed files with 6 additions and 6 deletions
+6 -4
View File
@@ -99,10 +99,12 @@ export const layer = Layer.effect(
Effect.fn("Agent.state")(function* (ctx) {
const cfg = yield* config.get()
const skillDirs = yield* skill.dirs()
const referenceDirs = yield* Effect.gen(function* () {
yield* (yield* PluginV2.Service).wait(PluginV2.ID.make("core/config-reference"))
return (yield* (yield* Reference.Service).list()).map((reference) => reference.path)
}).pipe(Effect.provide(locations.get(Location.Ref.make({ directory: AbsolutePath.make(ctx.directory) }))))
const referenceDirs = Object.keys(cfg.references ?? cfg.reference ?? {}).length
? yield* Effect.gen(function* () {
yield* (yield* PluginV2.Service).wait(PluginV2.ID.make("core/config-reference"))
return (yield* (yield* Reference.Service).list()).map((reference) => reference.path)
}).pipe(Effect.provide(locations.get(Location.Ref.make({ directory: AbsolutePath.make(ctx.directory) }))))
: []
const whitelistedDirs = [
Truncate.GLOB,
path.join(Global.Path.tmp, "*"),