Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

1.3 KB
Raw Blame
import { defineEval } from "eve/evals";
import {
  expectApprovalCancelled,
  scriptedSession,
  expectChangeStillUnexecuted,
  expectReply,
  expectToolResult,
  requestFrom,
} from "./helpers.ts";

export default defineEval({
  description:
    "A provider-executed tool result must get a follow-up model call while an older approval waits.",
  tags: ["hitl", "continuation", "regression", "user-message", "provider-result"],
  timeoutMs: 60_000,
  async test(t) {
    // Given change A is waiting for approval.
    const parked = await t.send("Prepare change A.", scriptedSession);
    const approval = requestFrom(parked, "change-a");
    const session = parked.session;

    // When the user asks the provider to look up the draft.
    const live = await session.start("Look up the draft with the provider and report its status.", {
      turnPolicy: "steer",
    });

    // Then the reply reports provider-ready and completes; the message cancelled A, which never runs.
    await expectToolResult(t, live, "read-draft");
    const reply = await expectReply(t, live, "Provider draft status: provider-ready.");
    reply.calledTool("read-draft", {
      status: "completed",
      output: { status: "provider-ready" },
      count: 1,
    });
    expectChangeStillUnexecuted(session);
    expectApprovalCancelled(session, approval);
  },
});