refactor(flags): migrate external skills flag (#27685)

This commit is contained in:
Shoubhit Dash
2026-05-15 13:24:56 +05:30
committed by GitHub
parent 2d6bedecd4
commit 22cb0395e2
5 changed files with 85 additions and 3 deletions

View File

@@ -5,7 +5,6 @@ import { NamedError } from "@opencode-ai/core/util/error"
import type { Agent } from "@/agent/agent"
import { Bus } from "@/bus"
import { InstanceState } from "@/effect/instance-state"
import { Flag } from "@opencode-ai/core/flag/flag"
import { Global } from "@opencode-ai/core/global"
import { Permission } from "@/permission"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
@@ -166,6 +165,7 @@ const discoverSkills = Effect.fnUntraced(function* (
discovery: Discovery.Interface,
fsys: AppFileSystem.Interface,
global: Global.Interface,
disableExternalSkills: boolean,
disableClaudeCodeSkills: boolean,
directory: string,
worktree: string,
@@ -173,7 +173,7 @@ const discoverSkills = Effect.fnUntraced(function* (
const state: ScanState = { matches: new Set(), dirs: new Set() }
const externalDirs: string[] = []
if (!Flag.OPENCODE_DISABLE_EXTERNAL_SKILLS) {
if (!disableExternalSkills) {
if (!disableClaudeCodeSkills) externalDirs.push(CLAUDE_EXTERNAL_DIR)
externalDirs.push(AGENTS_EXTERNAL_DIR)
@@ -249,6 +249,7 @@ export const layer = Layer.effect(
discovery,
fsys,
global,
flags.disableExternalSkills,
flags.disableClaudeCodeSkills,
ctx.directory,
ctx.worktree,