Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/commands/doctor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ mock.module('../plugins/agents/registry.js', () => ({
},
hasPlugin: (name: string) => name === 'claude' || name === 'opencode',
registerBuiltin: () => {},
initialize: () => Promise.resolve([]),
getRegisteredPlugins: () => [
{ id: 'claude', name: 'Claude Code', description: 'Claude AI', version: '1.0.0' },
{ id: 'opencode', name: 'OpenCode', description: 'OpenCode AI', version: '1.0.0' },
Expand Down
13 changes: 13 additions & 0 deletions src/commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ async function runDiagnostics(
// Get agent registry
const registry = getAgentRegistry();

// Discover user plugins (~/.config/ralph-tui/plugins/agents/) — run.tsx's
// initializePlugins() already does this before actually running an agent;
// doctor was missing it, so `doctor --agent <custom-plugin>` always
// reported "Unknown agent plugin" even for a plugin that `run` could
// load fine.
const userPluginResults = await registry.initialize();
if (process.env.RALPH_TUI_DEBUG_PLUGINS) {
// User plugin load failures are otherwise silent — registry.initialize()
// swallows the real error into a PluginLoadResult array that nothing
// prints. Opt-in dump for diagnosing why a custom plugin didn't register.
console.error('DEBUG user plugin load results:', JSON.stringify(userPluginResults, null, 2));
}

// Determine which agent to check using centralized logic
const agentConfig = getDefaultAgentConfig(storedConfig, { agent: agentOverride });

Expand Down