refactor(flags): route scout through runtime flags (#27318)

This commit is contained in:
Shoubhit Dash
2026-05-13 17:07:53 +05:30
committed by GitHub
parent 5975547c84
commit 4d205027ca
6 changed files with 227 additions and 234 deletions
+4 -2
View File
@@ -15,12 +15,12 @@ import PROMPT_TITLE from "./prompt/title.txt"
import { Permission } from "@/permission"
import { mergeDeep, pipe, sortBy, values } from "remeda"
import { Global } from "@opencode-ai/core/global"
import { Flag } from "@opencode-ai/core/flag/flag"
import path from "path"
import { Plugin } from "@/plugin"
import { Skill } from "../skill"
import { Effect, Context, Layer, Schema } from "effect"
import { InstanceState } from "@/effect/instance-state"
import { RuntimeFlags } from "@/effect/runtime-flags"
import * as Option from "effect/Option"
import * as OtelTracer from "@effect/opentelemetry/Tracer"
import { type DeepMutable } from "@opencode-ai/core/schema"
@@ -81,6 +81,7 @@ export const layer = Layer.effect(
const plugin = yield* Plugin.Service
const skill = yield* Skill.Service
const provider = yield* Provider.Service
const flags = yield* RuntimeFlags.Service
const state = yield* InstanceState.make<State>(
Effect.fn("Agent.state")(function* (ctx) {
@@ -195,7 +196,7 @@ export const layer = Layer.effect(
mode: "subagent",
native: true,
},
...(Flag.OPENCODE_EXPERIMENTAL_SCOUT
...(flags.experimentalScout
? {
scout: {
name: "scout",
@@ -453,6 +454,7 @@ export const defaultLayer = layer.pipe(
Layer.provide(Auth.defaultLayer),
Layer.provide(Config.defaultLayer),
Layer.provide(Skill.defaultLayer),
Layer.provide(RuntimeFlags.defaultLayer),
)
export * as Agent from "./agent"