summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKit Langton <[email protected]>2026-04-15 21:14:39 -0400
committerGitHub <[email protected]>2026-04-15 21:14:39 -0400
commit6d42f976447f1b150dd6582e38dd29e0f7100c1b (patch)
tree6fa0507af38cffb53f64f30e58ac150ff0992d78
parent307251bf3cc80131b4df4877d5c0cefc127828dd (diff)
downloadopencode-6d42f976447f1b150dd6582e38dd29e0f7100c1b.tar.gz
opencode-6d42f976447f1b150dd6582e38dd29e0f7100c1b.zip
fix: revert "core: move plugin initialisation to config layer override" (#22686)
-rw-r--r--packages/opencode/src/effect/app-runtime.ts20
-rw-r--r--packages/opencode/src/project/bootstrap.ts1
2 files changed, 2 insertions, 19 deletions
diff --git a/packages/opencode/src/effect/app-runtime.ts b/packages/opencode/src/effect/app-runtime.ts
index 668c89b60..257922daf 100644
--- a/packages/opencode/src/effect/app-runtime.ts
+++ b/packages/opencode/src/effect/app-runtime.ts
@@ -47,31 +47,13 @@ import { Pty } from "@/pty"
import { Installation } from "@/installation"
import { ShareNext } from "@/share/share-next"
import { SessionShare } from "@/share/session"
-import * as Effect from "effect/Effect"
-
-// Adjusts the default Config layer to ensure that plugins are always initialised before
-// any other layers read the current config
-const ConfigWithPluginPriority = Layer.effect(
- Config.Service,
- Effect.gen(function* () {
- const config = yield* Config.Service
- const plugin = yield* Plugin.Service
-
- return {
- ...config,
- get: () => Effect.andThen(plugin.init(), config.get),
- getGlobal: () => Effect.andThen(plugin.init(), config.getGlobal),
- getConsoleState: () => Effect.andThen(plugin.init(), config.getConsoleState),
- }
- }),
-).pipe(Layer.provide(Layer.merge(Plugin.defaultLayer, Config.defaultLayer)))
export const AppLayer = Layer.mergeAll(
AppFileSystem.defaultLayer,
Bus.defaultLayer,
Auth.defaultLayer,
Account.defaultLayer,
- ConfigWithPluginPriority,
+ Config.defaultLayer,
Git.defaultLayer,
Ripgrep.defaultLayer,
FileTime.defaultLayer,
diff --git a/packages/opencode/src/project/bootstrap.ts b/packages/opencode/src/project/bootstrap.ts
index 0babdfe13..a1f2a8cb0 100644
--- a/packages/opencode/src/project/bootstrap.ts
+++ b/packages/opencode/src/project/bootstrap.ts
@@ -15,6 +15,7 @@ import * as Effect from "effect/Effect"
export const InstanceBootstrap = Effect.gen(function* () {
Log.Default.info("bootstrapping", { directory: Instance.directory })
+ yield* Plugin.Service.use((svc) => svc.init())
yield* Effect.all(
[
LSP.Service,