266 266 assert.equal(r.context.counts.compactions, 1);
269 -test("text is opt-in, bounded, and never includes thinking, tool payloads, images or custom state", async (t) => {
269 +test("text is bounded while content exposes exact persisted payloads on request", async (t) => {
270 270 const f = fixture(t);
271 271 f.add("bounded", null, [
272 272 message("u", null, "user", { content: "x".repeat(10000) }),
273 273 message("a", "u", "assistant", {
274 + errorMessage: "EXACT_ERROR",
275 - { type: "thinking", thinking: "HIDDEN_THINKING" },
276 - { type: "image", data: "HIDDEN_IMAGE" },
276 + { type: "thinking", thinking: "EXACT_THINKING" },
277 + { type: "image", data: "EXACT_IMAGE", mimeType: "image/png" },
277 278 { type: "text", text: "visible answer" },
278 - { type: "toolCall", name: "bash", id: "t", arguments: { command: "HIDDEN_ARGUMENTS" } },
279 + { type: "toolCall", name: "bash", id: "t", arguments: { command: "EXACT_ARGUMENTS" } },
281 - message("r", "a", "toolResult", { content: [{ type: "text", text: "HIDDEN_RESULT" }] }),
282 - entry("custom", "r", "custom", { customType: "state", data: "HIDDEN_STATE" }),
282 + message("r", "a", "toolResult", {
283 + content: [{ type: "text", text: "EXACT_RESULT" }],
284 + details: { reason: "EXACT_DETAILS" },
286 + entry("custom", "r", "custom", { customType: "state", data: "EXACT_STATE" }),
284 288 const r = await inspect(["show", "bounded", "--text", "--limit", "1"], f.ctx);
285 289 assert.equal(r.total, 4);
286 290 assert.equal(r.timeline.length, 1);
287 291 assert.ok(r.timeline[0].text.length <= 500);
288 292 assert.equal(r.timeline[0].textTruncated, true);
289 - const full = await inspect(["show", "bounded", "--text"], f.ctx);
290 - assert.doesNotMatch(JSON.stringify(full), /HIDDEN_/);
291 - assert.equal(full.timeline[1].text, "visible answer");
293 + const text = await inspect(["show", "bounded", "--text"], f.ctx);
294 + assert.doesNotMatch(JSON.stringify(text), /EXACT_/);
295 + assert.equal(text.timeline[1].text, "visible answer");
296 + const content = await inspect(["show", "bounded", "--content"], f.ctx);
297 + assert.equal(content.timeline[1].payload.message.errorMessage, "EXACT_ERROR");
298 + assert.equal(content.timeline[1].payload.message.content[0].thinking, "EXACT_THINKING");
299 + assert.equal(content.timeline[1].payload.message.content[1].data, "EXACT_IMAGE");
300 + assert.equal(content.timeline[1].payload.message.content[3].arguments.command, "EXACT_ARGUMENTS");
301 + assert.equal(content.timeline[2].payload.message.content[0].text, "EXACT_RESULT");
302 + assert.equal(content.timeline[2].payload.message.details.reason, "EXACT_DETAILS");
303 + assert.equal(content.timeline[3].payload.data, "EXACT_STATE");
292 304 const page = await inspect(["show", "bounded", "--offset", "1", "--limit", "1"], f.ctx);
293 305 assert.equal(page.timeline[0].id, "a");
294 306 assert.equal(page.timeline[0].text, undefined);
307 + assert.equal(page.timeline[0].payload, undefined);
297 310 test("malformed lines and partial tails report locations, never parser content; listing is explicitly partial", async (t) => {