fix(ralph-loop): detect oracle VERIFIED tool results in session messages
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -89,7 +89,7 @@ describe("detectCompletionInSessionMessages", () => {
|
||||
})
|
||||
|
||||
describe("#given promise appears in tool_result part (not text part)", () => {
|
||||
test("#when Oracle returns VERIFIED via task() tool_result #then should NOT detect completion", async () => {
|
||||
test("#when Oracle returns VERIFIED via task() tool_result #then should detect completion", async () => {
|
||||
const messages = [
|
||||
{
|
||||
info: { role: "assistant" },
|
||||
@@ -116,6 +116,29 @@ describe("detectCompletionInSessionMessages", () => {
|
||||
sinceMessageIndex: 0,
|
||||
})
|
||||
|
||||
expect(detected).toBe(true)
|
||||
})
|
||||
|
||||
test("#when non-Oracle tool_result returns VERIFIED #then should NOT detect completion", async () => {
|
||||
const messages = [
|
||||
{
|
||||
info: { role: "assistant" },
|
||||
parts: [
|
||||
{ type: "tool_result", text: "Agent: explore\n\n<promise>VERIFIED</promise>" },
|
||||
{ type: "text", text: "Explore finished checking." },
|
||||
],
|
||||
},
|
||||
]
|
||||
const ctx = createPluginInput(messages)
|
||||
|
||||
const detected = await detectCompletionInSessionMessages(ctx, {
|
||||
sessionID: "session-123",
|
||||
promise: "VERIFIED",
|
||||
apiTimeoutMs: 1000,
|
||||
directory: "/tmp",
|
||||
sinceMessageIndex: 0,
|
||||
})
|
||||
|
||||
expect(detected).toBe(false)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user