fix(keyword-detector): trigger ulw shorthand anywhere

This commit is contained in:
YeonGyu-Kim
2026-04-10 11:12:56 +09:00
parent 5f90b238e0
commit f36231a8a6
3 changed files with 29 additions and 16 deletions
@@ -86,7 +86,7 @@ describe("keyword-detector ralph-loop activation", () => {
expect(startLoopCalls[0].options.ultrawork).toBe(true)
})
test("#given ulw mentioned mid-sentence #when chat.message fires #then ralph-loop startLoop is not invoked", async () => {
test("#given ulw mentioned mid-sentence #when chat.message fires #then ralph-loop startLoop is invoked", async () => {
// given
setMainSession("main-session")
const startLoopCalls: StartLoopCall[] = []
@@ -94,15 +94,16 @@ describe("keyword-detector ralph-loop activation", () => {
const hook = createKeywordDetectorHook(createMockPluginInput(), undefined, ralphLoop)
const output = {
message: {} as Record<string, unknown>,
parts: [{ type: "text", text: "I think ulw is cool" }],
parts: [{ type: "text", text: "please ulw fix the flaky keyword tests" }],
}
// when
await hook["chat.message"]({ sessionID: "main-session", agent: "sisyphus" }, output)
// then
expect(startLoopCalls).toHaveLength(0)
expect(output.parts[0]?.text).toBe("I think ulw is cool")
expect(startLoopCalls).toHaveLength(1)
expect(startLoopCalls[0].prompt).toBe("please fix the flaky keyword tests")
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 not invoked", async () => {