Skip to content

Commit 72612fc

Browse files
committed
fix(agent): initialize plugins before resolving config
Plugin config() hooks can mutate the agent registry. Agent.Service was snapshotting config before plugin init ran on early entry points like GET /agent, so plugin-provided agents were missing in the TUI agent picker after upgrading to v1.14.32. Re-submission of #25440 (auto-closed by template bot) with proper PR template. Original fix by @quangtran88.
1 parent 05b82a6 commit 72612fc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/opencode/src/agent/agent.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export const layer = Layer.effect(
7777
const skill = yield* Skill.Service
7878
const provider = yield* Provider.Service
7979

80+
// Some entry points resolve agents before project bootstrap runs, so ensure
81+
// plugin config hooks have mutated config before agent state snapshots it.
82+
yield* plugin.init()
83+
8084
const state = yield* InstanceState.make<State>(
8185
Effect.fn("Agent.state")(function* (ctx) {
8286
const cfg = yield* config.get()

0 commit comments

Comments
 (0)