test: trim duplicate smoke and embedded runner cases

This commit is contained in:
Peter Steinberger
2026-02-22 16:40:53 +00:00
parent ee7a43b895
commit bd6be417e4
2 changed files with 19 additions and 125 deletions

View File

@@ -356,21 +356,6 @@ describe("runEmbeddedPiAgent", () => {
).rejects.toThrow("Malformed agent session key");
});
it("persists the first user message before assistant output", { timeout: 120_000 }, async () => {
const sessionFile = nextSessionFile();
await runDefaultEmbeddedTurn(sessionFile, "hello");
const messages = await readSessionMessages(sessionFile);
const firstUserIndex = messages.findIndex(
(message) => message?.role === "user" && textFromContent(message.content) === "hello",
);
const firstAssistantIndex = messages.findIndex((message) => message?.role === "assistant");
expect(firstUserIndex).toBeGreaterThanOrEqual(0);
if (firstAssistantIndex !== -1) {
expect(firstUserIndex).toBeLessThan(firstAssistantIndex);
}
});
it("persists the user message when prompt fails before assistant output", async () => {
const sessionFile = nextSessionFile();
const cfg = makeOpenAiConfig(["mock-error"]);