feat(doctor): warn on legacy package name + add example configs
- Doctor now detects when opencode.json references 'oh-my-opencode' (legacy name) and warns users to switch to 'oh-my-openagent' with the exact replacement string. - Added 3 example config files in docs/examples/: - default.jsonc: balanced setup with all agents documented - coding-focused.jsonc: Sisyphus + Hephaestus heavy - planning-focused.jsonc: Prometheus + Atlas heavy All examples include every agent (sisyphus, hephaestus, atlas, prometheus, explore, librarian) with model recommendations. Helps with #2823
This commit is contained in:
@@ -6,6 +6,7 @@ import { findOpenCodeBinary, getOpenCodeVersion, compareVersions } from "./syste
|
||||
import { getPluginInfo } from "./system-plugin"
|
||||
import { getLatestPluginVersion, getLoadedPluginVersion, getSuggestedInstallTag } from "./system-loaded-version"
|
||||
import { parseJsonc } from "../../../shared"
|
||||
import { PLUGIN_NAME, LEGACY_PLUGIN_NAME } from "../../../shared/plugin-identity"
|
||||
|
||||
function isConfigValid(configPath: string | null): boolean {
|
||||
if (!configPath) return true
|
||||
@@ -90,6 +91,22 @@ export async function checkSystem(): Promise<CheckResult> {
|
||||
})
|
||||
}
|
||||
|
||||
// Detect legacy package name in plugin config
|
||||
if (pluginInfo.entry && !pluginInfo.isLocalDev) {
|
||||
const isLegacyName = pluginInfo.entry === LEGACY_PLUGIN_NAME
|
||||
|| pluginInfo.entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)
|
||||
if (isLegacyName) {
|
||||
const suggestedEntry = pluginInfo.entry.replace(LEGACY_PLUGIN_NAME, PLUGIN_NAME)
|
||||
issues.push({
|
||||
title: "Using legacy package name",
|
||||
description: `Your opencode.json references "${LEGACY_PLUGIN_NAME}" which has been renamed to "${PLUGIN_NAME}". The old name may stop working in a future release.`,
|
||||
fix: `Update your opencode.json plugin entry: "${pluginInfo.entry}" → "${suggestedEntry}"`,
|
||||
severity: "warning",
|
||||
affects: ["plugin loading"],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (loadedInfo.expectedVersion && loadedInfo.loadedVersion && loadedInfo.expectedVersion !== loadedInfo.loadedVersion) {
|
||||
issues.push({
|
||||
title: "Loaded plugin version mismatch",
|
||||
|
||||
Reference in New Issue
Block a user