Files
Mohamed Boudra 9c8d775895 Let plugins customize agent creation and observe lifecycle events (#4435)
* feat(plugins): expose agent and workspace lifecycle hooks

* test(plugins): verify lifecycle examples with version requirements

* fix(plugins): publish archive hooks for closed agents

* test(plugins): remove diagnostic catch from lifecycle test

* refactor(plugins): define hook handlers in lifecycle module
2026-09-07 19:17:42 +02:00

21 lines
841 B
TypeScript

import { expect, test } from "vitest";
import { latestOutputText } from "./inspect";
test("matches provider text split across timeline chunks without matching old turns or user prompts", () => {
const output = latestOutputText([
{ type: "user_message", text: "An older request" },
{ type: "assistant_message", text: "old out of credits" },
{ type: "user_message", text: "The user mentions out of credits" },
{ type: "assistant_message", text: "out", messageId: "reply" },
{ type: "assistant_message", text: " of credits", messageId: "reply" },
]);
expect(output).toBe("out of credits");
expect(
latestOutputText([
{ type: "assistant_message", text: "out of credits" },
{ type: "user_message", text: "Try again." },
{ type: "assistant_message", text: "Done" },
]),
).toBe("Done");
});