fix(ralph-loop): ignore synthetic idle replays
This commit is contained in:
@@ -58,6 +58,29 @@ describe("detectCompletionInSessionMessages", () => {
|
||||
// #then
|
||||
expect(detected).toBe(true)
|
||||
})
|
||||
|
||||
test("#when sinceMessageIndex equals current message count #then should NOT rescan old DONE", async () => {
|
||||
// #given
|
||||
const messages = [
|
||||
{
|
||||
info: { role: "assistant" },
|
||||
parts: [{ type: "text", text: "Old completion <promise>DONE</promise>" }],
|
||||
},
|
||||
]
|
||||
const ctx = createPluginInput(messages)
|
||||
|
||||
// #when
|
||||
const detected = await detectCompletionInSessionMessages(ctx, {
|
||||
sessionID: "session-123",
|
||||
promise: "DONE",
|
||||
apiTimeoutMs: 1000,
|
||||
directory: "/tmp",
|
||||
sinceMessageIndex: messages.length,
|
||||
})
|
||||
|
||||
// #then
|
||||
expect(detected).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given no sinceMessageIndex (backward compat)", () => {
|
||||
|
||||
Reference in New Issue
Block a user