refactor(tool-config): use getAgentListDisplayName for consistent naming
Update tool config handler to use getAgentListDisplayName for proper agent name resolution in tool configurations. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import type { OhMyOpenCodeConfig } from "../config";
|
import type { OhMyOpenCodeConfig } from "../config";
|
||||||
import { getAgentDisplayName } from "../shared/agent-display-names";
|
import { getAgentDisplayName, getAgentListDisplayName } from "../shared/agent-display-names";
|
||||||
import { isTaskSystemEnabled } from "../shared";
|
import { isTaskSystemEnabled } from "../shared";
|
||||||
|
|
||||||
type AgentWithPermission = { permission?: Record<string, unknown> };
|
type AgentWithPermission = { permission?: Record<string, unknown> };
|
||||||
@@ -16,7 +16,7 @@ function getConfigQuestionPermission(): string | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function agentByKey(agentResult: Record<string, unknown>, key: string): AgentWithPermission | undefined {
|
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
|
| AgentWithPermission
|
||||||
| undefined;
|
| undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user