fix(config): support oh-my-openagent.jsonc as alternative config file name (fixes #2624)

The project was renamed from oh-my-opencode to oh-my-openagent.
Users creating oh-my-openagent.jsonc expect it to be loaded.

Now all config file discovery paths check for oh-my-openagent as
a fallback when oh-my-opencode is not found:
- plugin-config.ts (user-level and project-level)
- doctor config check
- LSP server config loader
- opencode-config-dir paths

oh-my-opencode remains the primary name for backward compatibility.

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
YeonGyu-Kim
2026-03-18 12:08:47 +09:00
parent 55ac653eaa
commit f6ca8bc934
5 changed files with 41 additions and 6 deletions
+9
View File
@@ -9,8 +9,11 @@ import { loadAvailableModelsFromCache } from "./model-resolution-cache"
import { getModelResolutionInfoWithOverrides } from "./model-resolution"
import type { OmoConfig } from "./model-resolution-types"
const PACKAGE_NAME_ALT = "oh-my-openagent"
const USER_CONFIG_BASE = join(getOpenCodeConfigDir({ binary: "opencode" }), PACKAGE_NAME)
const USER_CONFIG_BASE_ALT = join(getOpenCodeConfigDir({ binary: "opencode" }), PACKAGE_NAME_ALT)
const PROJECT_CONFIG_BASE = join(process.cwd(), ".opencode", PACKAGE_NAME)
const PROJECT_CONFIG_BASE_ALT = join(process.cwd(), ".opencode", PACKAGE_NAME_ALT)
interface ConfigValidationResult {
exists: boolean
@@ -24,9 +27,15 @@ function findConfigPath(): string | null {
const projectConfig = detectConfigFile(PROJECT_CONFIG_BASE)
if (projectConfig.format !== "none") return projectConfig.path
const projectConfigAlt = detectConfigFile(PROJECT_CONFIG_BASE_ALT)
if (projectConfigAlt.format !== "none") return projectConfigAlt.path
const userConfig = detectConfigFile(USER_CONFIG_BASE)
if (userConfig.format !== "none") return userConfig.path
const userConfigAlt = detectConfigFile(USER_CONFIG_BASE_ALT)
if (userConfigAlt.format !== "none") return userConfigAlt.path
return null
}