test(keyword-detector): add plain ulw no-loop regressions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -35,7 +35,7 @@ function createMockRalphLoop(startLoopCalls: StartLoopCall[], cancelLoopCalls: C
|
||||
}
|
||||
}
|
||||
|
||||
describe("keyword-detector ralph-loop activation", () => {
|
||||
describe("keyword-detector ultrawork routing", () => {
|
||||
beforeEach(() => {
|
||||
_resetForTesting()
|
||||
})
|
||||
@@ -44,7 +44,7 @@ describe("keyword-detector ralph-loop activation", () => {
|
||||
_resetForTesting()
|
||||
})
|
||||
|
||||
test("#given ulw keyword in main session #when chat.message fires #then ralph-loop startLoop is invoked with the user task", async () => {
|
||||
test("#given ulw keyword in main session #when chat.message fires #then ultrawork prompt is injected without starting ralph loop", async () => {
|
||||
// given
|
||||
setMainSession("main-session")
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -59,13 +59,12 @@ describe("keyword-detector ralph-loop activation", () => {
|
||||
await hook["chat.message"]({ sessionID: "main-session", agent: "sisyphus" }, output)
|
||||
|
||||
// then
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0].sessionID).toBe("main-session")
|
||||
expect(startLoopCalls[0].prompt).toContain("build a multi-agent backend architecture")
|
||||
expect(startLoopCalls[0].options.ultrawork).toBe(true)
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("YOU MUST LEVERAGE ALL AVAILABLE AGENTS")
|
||||
expect(output.parts[0]?.text).toContain("ulw build a multi-agent backend architecture")
|
||||
})
|
||||
|
||||
test("#given ultrawork keyword in main session #when chat.message fires #then ralph-loop startLoop is invoked with ultrawork enabled", async () => {
|
||||
test("#given ultrawork keyword in main session #when chat.message fires #then ultrawork prompt is injected without starting ralph loop", async () => {
|
||||
// given
|
||||
setMainSession("main-session")
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -80,13 +79,12 @@ describe("keyword-detector ralph-loop activation", () => {
|
||||
await hook["chat.message"]({ sessionID: "main-session", agent: "sisyphus" }, output)
|
||||
|
||||
// then
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0].sessionID).toBe("main-session")
|
||||
expect(startLoopCalls[0].prompt).toContain("ship the dashboard")
|
||||
expect(startLoopCalls[0].options.ultrawork).toBe(true)
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("YOU MUST LEVERAGE ALL AVAILABLE AGENTS")
|
||||
expect(output.parts[0]?.text).toContain("ultrawork ship the dashboard")
|
||||
})
|
||||
|
||||
test("#given ulw mentioned mid-sentence #when chat.message fires #then ralph-loop startLoop is invoked", async () => {
|
||||
test("#given ulw mentioned mid-sentence #when chat.message fires #then ultrawork prompt is injected without starting ralph loop", async () => {
|
||||
// given
|
||||
setMainSession("main-session")
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -101,12 +99,11 @@ describe("keyword-detector ralph-loop activation", () => {
|
||||
await hook["chat.message"]({ sessionID: "main-session", agent: "sisyphus" }, output)
|
||||
|
||||
// then
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0].prompt).toBe("please fix the flaky keyword tests")
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("please ulw fix the flaky keyword tests")
|
||||
})
|
||||
|
||||
test("#given question about ultrawork #when chat.message fires #then ralph-loop startLoop is invoked", async () => {
|
||||
test("#given question about ultrawork #when chat.message fires #then ultrawork prompt is injected without starting ralph loop", async () => {
|
||||
// given
|
||||
setMainSession("main-session")
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -121,8 +118,7 @@ describe("keyword-detector ralph-loop activation", () => {
|
||||
await hook["chat.message"]({ sessionID: "main-session", agent: "sisyphus" }, output)
|
||||
|
||||
// then
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0].prompt).toBe("what is ?")
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("what is ultrawork?")
|
||||
})
|
||||
|
||||
@@ -239,7 +235,7 @@ The system mentions ulw mode in passing.
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
})
|
||||
|
||||
test("#given ulw keyword #when chat.message fires #then prompt is also injected as before", async () => {
|
||||
test("#given ulw keyword #when chat.message fires #then prompt is injected as before without starting ralph loop", async () => {
|
||||
// given
|
||||
setMainSession("main-session")
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -257,6 +253,6 @@ The system mentions ulw mode in passing.
|
||||
const textPart = output.parts.find((p) => p.type === "text")
|
||||
expect(textPart!.text).toContain("YOU MUST LEVERAGE ALL AVAILABLE AGENTS")
|
||||
expect(textPart!.text).toContain("refactor the codebase")
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user