fix: unify agent display names and strip invisible sort prefixes
- Replace getAgentRuntimeName with getAgentDisplayName for consistency - Add stripAgentListSortPrefix helper to normalize agent names - Strip sort prefixes in subagent-resolver and sync-executor - Backfill canonical names for core agents when builtin configs omit name - Update tests to match new behavior
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
import { getAgentDisplayName, getAgentRuntimeName } from "../shared/agent-display-names"
|
||||
import { getAgentDisplayName } from "../shared/agent-display-names"
|
||||
|
||||
function rewriteAgentNameForListDisplay(
|
||||
key: string,
|
||||
value: unknown,
|
||||
): unknown {
|
||||
if (typeof value !== "object" || value === null || !("name" in value)) {
|
||||
if (typeof value !== "object" || value === null) {
|
||||
return value
|
||||
}
|
||||
|
||||
const agent = value as Record<string, unknown>
|
||||
if (typeof agent.name !== "string") {
|
||||
return value
|
||||
}
|
||||
|
||||
return {
|
||||
...agent,
|
||||
name: getAgentRuntimeName(key),
|
||||
name: getAgentDisplayName(key),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user