char-slop/berry

multipurpose self-modifiable agentic harness

git clone https://git.t4t.associates/char-slop/berry

Charlotte Somsubagent: show compact lifecycle events2c34403

main
797 B20 linesraw
1import { assert, assertStringIncludes } from "@std/assert";
2import { withDom } from "@berry/util/dom.ts";
3import { event } from "./event.tsx";
4
5Deno.test("subagent lifecycle events render without being mistaken for model configuration", () =>
6  withDom(() => {
7    const lifecycle = event({
8      ext: "subagent",
9      event: { type: "spawned", conversationId: 2, task: "check the build" },
10    });
11    assertStringIncludes(lifecycle!.textContent!, "spawned");
12    assertStringIncludes(lifecycle!.textContent!, "2");
13    assert(!lifecycle!.textContent!.includes("check the build"));
14
15    const models = event({
16      ext: "subagent",
17      event: { type: "models", models: [{ provider: "faux", modelId: "worker" }] },
18    });
19    assertStringIncludes(models!.textContent!, "faux/worker");
20  }));