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:
@@ -40,7 +40,7 @@ describe("keyword-detector ultrawork edge trigger", () => {
|
||||
_resetForTesting()
|
||||
})
|
||||
|
||||
test("#given greeting text before ulw and surrounding whitespace #when chat.message fires #then ultrawork still activates", async () => {
|
||||
test("#given greeting text before ulw and surrounding whitespace #when chat.message fires #then ultrawork still activates without starting ralph loop", async () => {
|
||||
// given
|
||||
const toastCalls: string[] = []
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -59,22 +59,12 @@ describe("keyword-detector ultrawork edge trigger", () => {
|
||||
|
||||
// then
|
||||
expect(toastCalls).toContain("Ultrawork Mode Activated")
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0]).toEqual({
|
||||
sessionID: "main-session",
|
||||
prompt: "Complete the task as instructed",
|
||||
options: {
|
||||
ultrawork: true,
|
||||
maxIterations: undefined,
|
||||
completionPromise: undefined,
|
||||
strategy: undefined,
|
||||
},
|
||||
})
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("ULTRAWORK MODE ENABLED!")
|
||||
expect(output.parts[0]?.text).toContain(" hi there ulw ")
|
||||
})
|
||||
|
||||
test("#given greeting before ulw with a trailing task #when chat.message fires #then ultrawork activates and preserves the task", async () => {
|
||||
test("#given greeting before ulw with a trailing task #when chat.message fires #then ultrawork activates and preserves the task without starting ralph loop", async () => {
|
||||
// given
|
||||
const toastCalls: string[] = []
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -93,22 +83,12 @@ describe("keyword-detector ultrawork edge trigger", () => {
|
||||
|
||||
// then
|
||||
expect(toastCalls).toContain("Ultrawork Mode Activated")
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0]).toEqual({
|
||||
sessionID: "main-session",
|
||||
prompt: "fix the flaky keyword tests",
|
||||
options: {
|
||||
ultrawork: true,
|
||||
maxIterations: undefined,
|
||||
completionPromise: undefined,
|
||||
strategy: undefined,
|
||||
},
|
||||
})
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("ULTRAWORK MODE ENABLED!")
|
||||
expect(output.parts[0]?.text).toContain("hey ulw fix the flaky keyword tests")
|
||||
})
|
||||
|
||||
test("#given ulw mentioned in the middle of a sentence #when chat.message fires #then ultrawork still activates", async () => {
|
||||
test("#given ulw mentioned in the middle of a sentence #when chat.message fires #then ultrawork still activates without starting ralph loop", async () => {
|
||||
// given
|
||||
const toastCalls: string[] = []
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -127,12 +107,11 @@ describe("keyword-detector ultrawork edge trigger", () => {
|
||||
|
||||
// then
|
||||
expect(toastCalls).toContain("Ultrawork Mode Activated")
|
||||
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 trailing ultrawork reference without punctuation #when chat.message fires #then ultrawork still activates", async () => {
|
||||
test("#given trailing ultrawork reference without punctuation #when chat.message fires #then ultrawork still activates without starting ralph loop", async () => {
|
||||
// given
|
||||
const toastCalls: string[] = []
|
||||
const startLoopCalls: StartLoopCall[] = []
|
||||
@@ -151,8 +130,7 @@ describe("keyword-detector ultrawork edge trigger", () => {
|
||||
|
||||
// then
|
||||
expect(toastCalls).toContain("Ultrawork Mode Activated")
|
||||
expect(startLoopCalls).toHaveLength(1)
|
||||
expect(startLoopCalls[0]?.prompt).toBe("what is")
|
||||
expect(startLoopCalls).toHaveLength(0)
|
||||
expect(output.parts[0]?.text).toContain("what is ultrawork")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user