fix: resolve category delegation and command routing with display name agent keys
Category-based delegation (task(category='quick')) was broken because
SISYPHUS_JUNIOR_AGENT sent 'sisyphus-junior' to session.prompt but
config.agent keys are now display names ('Sisyphus-Junior').
- Use getAgentDisplayName() for SISYPHUS_JUNIOR_AGENT constant
- Replace hardcoded 'sisyphus-junior' strings in tools.ts with constant
- Update background-output local constants to use display names
- Add remapCommandAgentFields() to translate command agent fields
- Add raw-key fallback in tool-config-handler agentByKey()
This commit is contained in:
@@ -452,7 +452,7 @@ describe("sisyphus-task", () => {
|
||||
await tool.execute(args, toolContext)
|
||||
|
||||
// then
|
||||
expect(args.subagent_type).toBe("sisyphus-junior")
|
||||
expect(args.subagent_type).toBe("Sisyphus-Junior")
|
||||
}, { timeout: 10000 })
|
||||
|
||||
test("category overrides subagent_type and still maps to sisyphus-junior", async () => {
|
||||
@@ -517,7 +517,7 @@ describe("sisyphus-task", () => {
|
||||
const result = await tool.execute(args, toolContext)
|
||||
|
||||
//#then
|
||||
expect(args.subagent_type).toBe("sisyphus-junior")
|
||||
expect(args.subagent_type).toBe("Sisyphus-Junior")
|
||||
expect(result).toContain("Background task launched")
|
||||
}, { timeout: 10000 })
|
||||
|
||||
@@ -3718,7 +3718,7 @@ describe("sisyphus-task", () => {
|
||||
)
|
||||
|
||||
// then - title should follow OpenCode format
|
||||
expect(createBody.title).toBe("Implement feature X (@sisyphus-junior subagent)")
|
||||
expect(createBody.title).toBe("Implement feature X (@Sisyphus-Junior subagent)")
|
||||
}, { timeout: 10000 })
|
||||
|
||||
test("sync task output includes <task_metadata> block with session_id", async () => {
|
||||
|
||||
Reference in New Issue
Block a user