Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

1.1 KB
Raw Blame
import { defineEval } from "eve/evals";

export default defineEval({
  description: "auto() preserves model selection when a question resumes the current turn.",
  async test(t) {
    const parked = await t.send("Run the auto-resume-question flow for this routine request.");
    parked.expectOk();
    parked.calledTool("ask_question", { count: 1, status: "pending" });
    const question = parked.session.requireInputRequest({
      prompt: (prompt) => /Which environment/iu.test(prompt),
      toolName: "ask_question",
    });
    const staging = question.options?.find((option) => option.label === "Staging");
    if (staging === undefined) throw new Error("ask_question did not offer Staging.");

    const resumed = await parked.session.respond([
      { optionId: staging.id, requestId: question.requestId },
    ]);

    resumed.expectOk();
    resumed.calledTool("ask_question", {
      count: 1,
      output: { answer: "Staging", status: "answered" },
      status: "completed",
    });
    resumed.messageIncludes("Question answered");
    resumed.notEvent("step.failed");
    resumed.notEvent("turn.failed");
    t.noFailedActions();
  },
});