fix(config): resolve agent/command names from relative paths (#28359)

This commit is contained in:
Kit Langton
2026-05-19 16:48:32 -04:00
committed by GitHub
parent c035c35eba
commit e94d46af86
4 changed files with 73 additions and 13 deletions
+2 -2
View File
@@ -1,5 +1,6 @@
export * as ConfigCommand from "./command"
import path from "path"
import * as Log from "@opencode-ai/core/util/log"
import { Cause, Exit, Schema } from "effect"
import { Glob } from "@opencode-ai/core/util/glob"
@@ -36,8 +37,7 @@ export async function load(dir: string) {
})
if (!md) continue
const patterns = ["/.opencode/command/", "/.opencode/commands/", "/command/", "/commands/"]
const name = configEntryNameFromPath(item, patterns)
const name = configEntryNameFromPath(path.relative(dir, item), ["command/", "commands/"])
const config = {
name,