fix: permanently resolve agent name duplication yo-yo bug

This commit is contained in:
Sami Jawhar
2026-03-29 04:02:13 +00:00
parent 3dc11ea620
commit 4314a3e482
9 changed files with 180 additions and 16 deletions
@@ -1,3 +1,5 @@
import { getAgentConfigKey } from "../../shared/agent-display-names"
export const subagentSessions = new Set<string>()
export const syncSubagentSessions = new Set<string>()
@@ -14,7 +16,13 @@ export function getMainSessionID(): string | undefined {
const registeredAgentNames = new Set<string>()
export function registerAgentName(name: string): void {
registeredAgentNames.add(name.toLowerCase())
const normalizedName = name.toLowerCase()
registeredAgentNames.add(normalizedName)
const configKey = getAgentConfigKey(name).toLowerCase()
if (configKey !== normalizedName) {
registeredAgentNames.add(configKey)
}
}
export function isAgentRegistered(name: string): boolean {