From 8f129eb4ad97cc37c2fe88895d6c21dd82048ad7 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 7 Apr 2026 19:05:14 +0900 Subject: [PATCH] fix(test): update plugin tests to use getAgentListDisplayName for agent assertions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update plugin-interface.test.ts expectations to use getAgentListDisplayName - Update chat-message.test.ts expectations for agent display names - Add smoke test for quoted plan name resolution in chat-message.test.ts - Aligns test expectations with proper agent name formatting 🤖 Generated with OhMyOpenCode assistance --- src/plugin-interface.test.ts | 2 +- src/plugin/chat-message.test.ts | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/plugin-interface.test.ts b/src/plugin-interface.test.ts index 4dac3f7be..a3699668c 100644 --- a/src/plugin-interface.test.ts +++ b/src/plugin-interface.test.ts @@ -165,7 +165,7 @@ describe("createPluginInterface - command.execute.before", () => { ) // then - expect(output.message.agent).toBe("atlas") + expect(output.message.agent).toBe(getAgentListDisplayName("atlas")) expect(getSessionAgent("ses-command-atlas")).toBe("atlas") expect(readBoulderState(testDir)?.agent).toBe("atlas") }) diff --git a/src/plugin/chat-message.test.ts b/src/plugin/chat-message.test.ts index e7128140b..4c2757d23 100644 --- a/src/plugin/chat-message.test.ts +++ b/src/plugin/chat-message.test.ts @@ -87,13 +87,41 @@ describe("createChatMessageHandler - /start-work integration", () => { await handler(input, output) // then - expect(output.message["agent"]).toBe("sisyphus") + expect(output.message["agent"]).toBe("Sisyphus - Ultraworker") expect(output.parts[0].text).toContain("") expect(output.parts[0].text).toContain("Auto-Selected Plan") expect(output.parts[0].text).toContain("boulder.json has been created") expect(getSessionAgent("test-session")).toBe("sisyphus") expect(readBoulderState(testDir)?.agent).toBe("sisyphus") }) + + test("smoke: resolves quoted human-readable plan names through the full /start-work chat.message path", async () => { + // given + writeFileSync(join(testDir, ".sisyphus", "plans", "my-feature-plan.md"), "# Plan\n- [ ] Task 1") + updateSessionAgent("test-session", "prometheus") + const args = createMockHandlerArgs() + args.hooks.autoSlashCommand = createAutoSlashCommandHook({ skills: [] }) + args.hooks.startWork = createStartWorkHook({ + directory: testDir, + client: { tui: { showToast: async () => {} } }, + } as never) + const handler = createChatMessageHandler(args) + const input = createMockInput("prometheus") + const output: ChatMessageHandlerOutput = { + message: {}, + parts: [{ type: "text", text: "/start-work \"my feature plan\"" }], + } + + // when + await handler(input, output) + + // then + expect(output.message["agent"]).toBe("Sisyphus - Ultraworker") + expect(output.parts[0].text).toContain("") + expect(output.parts[0].text).toContain("Auto-Selected Plan") + expect(output.parts[0].text).toContain("my-feature-plan") + expect(readBoulderState(testDir)?.plan_name).toBe("my-feature-plan") + }) }) describe("createChatMessageHandler - /ulw-loop raw slash fallback", () => {