fix(agents): use list display names for ordered agent config

This commit is contained in:
YeonGyu-Kim
2026-03-31 15:11:00 -07:00
parent 1d0135b230
commit e2e57bb2dd
7 changed files with 59 additions and 24 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import type { OhMyOpenCodeConfig } from "../config";
import { getAgentDisplayName } from "../shared/agent-display-names";
import { getAgentDisplayName, getAgentListDisplayName } from "../shared/agent-display-names";
type AgentWithPermission = { permission?: Record<string, unknown> };
@@ -15,7 +15,7 @@ function getConfigQuestionPermission(): string | null {
}
function agentByKey(agentResult: Record<string, unknown>, key: string): AgentWithPermission | undefined {
return (agentResult[getAgentDisplayName(key)] ?? agentResult[key]) as
return (agentResult[getAgentListDisplayName(key)] ?? agentResult[getAgentDisplayName(key)] ?? agentResult[key]) as
| AgentWithPermission
| undefined;
}