Fix invisible characters in agent names

This commit is contained in:
YeonGyu-Kim
2026-04-11 20:44:57 +09:00
parent bbec1883fd
commit a442976d77
4 changed files with 55 additions and 4 deletions
@@ -163,6 +163,21 @@ describe("resolveSubagentExecution", () => {
expect(result.categoryModel).toEqual({ providerID: "openai", modelID: "gpt-5.3-codex" })
})
test("matches agents even when zero-width characters are present in the requested name", async () => {
//#given
const args = createBaseArgs({ subagent_type: "\uFEFFSisyphus - Ultraworker" })
const executorCtx = createExecutorContext(async () => ([
{ name: "\u200BSisyphus - Ultraworker", mode: "subagent", model: "openai/gpt-5.3-codex" },
]))
//#when
const result = await resolveSubagentExecution(args, executorCtx, "oracle", "deep")
//#then
expect(result.error).toBeUndefined()
expect(result.agentToUse).toBe("Sisyphus - Ultraworker")
})
test("uses agent override fallback_models for subagent runtime fallback chain", async () => {
//#given
readProviderModelsCacheMock.mockReturnValue({