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:
YeonGyu-Kim
2026-04-11 14:53:01 +09:00
parent c30b058b7e
commit 9f135af41c
9 changed files with 180 additions and 37 deletions
@@ -280,6 +280,27 @@ describe("executeSync", () => {
expect(deps.processMessages).not.toHaveBeenCalled()
})
test("strips invisible sort prefixes before sending sync prompts", async () => {
//#given
const executeSync = await importExecuteSync()
const deps = createDependencies()
const toolContext = createToolContext()
const recorder = createPromptAsyncRecorder()
const args = {
subagent_type: "\u200BSisyphus - Ultraworker",
description: "prefixed agent",
prompt: "find something",
run_in_background: false,
}
//#when
await executeSync(args, toolContext, createContext(recorder.promptAsync) as never, deps)
//#then
const promptInput = recorder.getCapturedInput()
expect(promptInput?.body.agent).toBe("Sisyphus - Ultraworker")
})
test("returns generic prompt failure with task metadata", async () => {
//#given
const executeSync = await importExecuteSync()