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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user