headroom / plugins /openclaw /test /engine-normalization.test.ts
JerrettDavis's picture
fix(openclaw): normalize engine messages for discord
14ba239
import { describe, expect, it } from "vitest";
import { HeadroomContextEngine } from "../src/engine.js";
describe("HeadroomContextEngine", () => {
it("normalizes pass-through assistant messages when no proxy is available", async () => {
const engine = new HeadroomContextEngine({ enabled: false });
const result = await engine.assemble({
sessionId: "test-session",
messages: [
{ role: "user", content: "hi", timestamp: Date.now() },
{ role: "assistant", content: "hello there", timestamp: Date.now() },
],
});
expect(result.messages[1]).toMatchObject({
role: "assistant",
content: [{ type: "text", text: "hello there" }],
});
});
});