Skip to content

Commit 343f29b

Browse files
authored
Improve the prompt for the "modes" e2e test (#4055)
1 parent 1441112 commit 343f29b

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

.changeset/fine-eels-find.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Improve the prompt for the "modes" e2e test
Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,24 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "@roo-code/types"
4-
53
import { waitUntilCompleted } from "./utils"
64

75
suite("Roo Code Modes", () => {
86
test("Should handle switching modes correctly", async () => {
9-
const api = globalThis.api
10-
11-
const switchModesPrompt =
12-
"For each mode (Architect, Ask, Debug) respond with the mode name and what it specializes in after switching to that mode."
13-
14-
const messages: ClineMessage[] = []
15-
const modeSwitches: string[] = []
7+
const modes: string[] = []
168

17-
api.on("taskModeSwitched", (_taskId, mode) => {
18-
console.log("taskModeSwitched", mode)
19-
modeSwitches.push(mode)
20-
})
21-
22-
api.on("message", ({ message }) => {
23-
if (message.type === "say" && message.partial === false) {
24-
messages.push(message)
25-
}
26-
})
9+
globalThis.api.on("taskModeSwitched", (_taskId, mode) => modes.push(mode))
2710

28-
const switchModesTaskId = await api.startNewTask({
11+
const switchModesTaskId = await globalThis.api.startNewTask({
2912
configuration: { mode: "code", alwaysAllowModeSwitch: true, autoApprovalEnabled: true },
30-
text: switchModesPrompt,
13+
text: "For each of `architect`, `ask`, and `debug` use the `switch_mode` tool to switch to that mode.",
3114
})
3215

33-
await waitUntilCompleted({ api, taskId: switchModesTaskId })
34-
await api.cancelCurrentTask()
16+
await waitUntilCompleted({ api: globalThis.api, taskId: switchModesTaskId })
17+
await globalThis.api.cancelCurrentTask()
3518

36-
assert.ok(modeSwitches.includes("architect"))
37-
assert.ok(modeSwitches.includes("ask"))
38-
assert.ok(modeSwitches.includes("debug"))
19+
assert.ok(modes.includes("architect"))
20+
assert.ok(modes.includes("ask"))
21+
assert.ok(modes.includes("debug"))
22+
assert.ok(modes.length === 3)
3923
})
4024
})

0 commit comments

Comments
 (0)