fix(slashcommand): add startWorkConfig to CommandDiscoveryOptions

discoverCommandsSync() was calling loadBuiltinCommands() with no config, always rendering the /start-work template with worktree instructions regardless of user config.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
acamq
2026-03-11 19:40:49 -06:00
parent 6e03a7d501
commit 317c402afe
+2 -1
View File
@@ -15,6 +15,7 @@ import type { CommandInfo, CommandMetadata, CommandScope } from "./types"
export interface CommandDiscoveryOptions {
pluginsEnabled?: boolean
enabledPluginsOverride?: Record<string, boolean>
startWorkConfig?: { worktree?: boolean }
}
function discoverCommandsFromDir(commandsDir: string, scope: CommandScope): CommandInfo[] {
@@ -91,7 +92,7 @@ export function discoverCommandsSync(
const opencodeProjectCommands = discoverCommandsFromDir(opencodeProjectDir, "opencode-project")
const pluginCommands = discoverPluginCommands(options)
const builtinCommandsMap = loadBuiltinCommands()
const builtinCommandsMap = loadBuiltinCommands(undefined, options?.startWorkConfig)
const builtinCommands: CommandInfo[] = Object.values(builtinCommandsMap).map((command) => ({
name: command.name,
metadata: {