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
View File
@@ -68,6 +68,7 @@ export interface AutoSlashCommandHookOptions {
skills?: LoadedSkill[]
pluginsEnabled?: boolean
enabledPluginsOverride?: Record<string, boolean>
directory?: string
}
export function createAutoSlashCommandHook(options?: AutoSlashCommandHookOptions) {
@@ -75,6 +76,7 @@ export function createAutoSlashCommandHook(options?: AutoSlashCommandHookOptions
skills: options?.skills,
pluginsEnabled: options?.pluginsEnabled,
enabledPluginsOverride: options?.enabledPluginsOverride,
directory: options?.directory,
}
const sessionProcessedCommands = createProcessedCommandStore()
const sessionProcessedCommandExecutions = createProcessedCommandStore()