fix(core): isolate location layer instances

This commit is contained in:
Dax Raad 2026-05-30 19:59:56 -04:00
commit 0269d6f5de
4 changed files with 65 additions and 9 deletions

View file

@ -2,18 +2,16 @@ import { Layer, LayerMap } from "effect"
import { Location } from "./location"
import { Catalog } from "./catalog"
import { PluginBoot } from "./plugin/boot"
import { Policy } from "./policy"
import { Config } from "./config"
import { AgentV2 } from "./agent"
export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("@opencode/example/LocationServiceMap", {
lookup: (ref: Location.Ref) => {
const result = Layer.mergeAll(
Catalog.defaultLayer,
PluginBoot.defaultLayer,
Config.defaultLayer,
AgentV2.defaultLayer,
).pipe(Layer.provideMerge(Policy.defaultLayer), Layer.provideMerge(Location.defaultLayer(ref)))
const result = Layer.fresh(
Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer, Config.defaultLayer, AgentV2.defaultLayer).pipe(
Layer.provideMerge(Location.defaultLayer(ref)),
),
)
return result
},
idleTimeToLive: "60 minutes",