import { describe, expect, it } from "vitest"; import { buildThinkingLogEntries } from "./agent-thinking-log"; describe("buildThinkingLogEntries", () => { it("maps thinking summary lines into ordered plain-text agent log entries", () => { const entries = buildThinkingLogEntries({ thinkingSummary: [ "Resolved scope to System Requirements Specification.", "Mode: ask. Board changes are disabled for this request.", "Using live model gpt-test.", "Provider returned non-JSON output; preserving assistant text and skipping board mutation.", ], }); expect(entries.map((entry) => entry.title)).toEqual([ "Scope resolved", "Mutation policy", "Provider selected", "Thinking", ]); expect(entries.map((entry) => entry.detail)).toEqual([ "Resolved scope to System Requirements Specification.", "Mode: ask. Board changes are disabled for this request.", "Using live model gpt-test.", "Provider returned non-JSON output; preserving assistant text and skipping board mutation.", ]); expect(entries.every((entry) => entry.level === "info")).toBe(true); }); });