fix(auto-slash-command): resolve project commands from session dir

Use the plugin session directory instead of process.cwd() when resolving project slash commands. This restores project and opencode-project slashcommand behavior when the runtime cwd differs from the actual session workspace.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-31 22:08:00 -07:00
parent 7f846b2da3
commit ea14a1a346
5 changed files with 71 additions and 2 deletions
+2 -1
View File
@@ -42,11 +42,12 @@ export interface ExecutorOptions {
pluginsEnabled?: boolean
enabledPluginsOverride?: Record<string, boolean>
agent?: string
directory?: string
}
async function discoverAllCommands(options?: ExecutorOptions): Promise<CommandInfo[]> {
const discoveredCommands = discoverCommandsSync(process.cwd(), {
const discoveredCommands = discoverCommandsSync(options?.directory ?? process.cwd(), {
pluginsEnabled: options?.pluginsEnabled,
enabledPluginsOverride: options?.enabledPluginsOverride,
})