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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user