Fix terminal snapshots reflowing after resize

Terminal snapshots now carry soft-wrap row metadata only to clients that advertise support, so restored output can resize like live output without breaking older clients.
This commit is contained in:
Mohamed Boudra
2026-05-31 19:40:15 +07:00
parent 794cbcef63
commit 4cc72a84e8
18 changed files with 538 additions and 146 deletions
@@ -64,7 +64,13 @@ describe("shared messages tool_call schema", () => {
error: null,
});
const withTopLevelInputOutput = AgentTimelineItemPayloadSchema.safeParse({
expect(missingCallId.success).toBe(false);
expect(unknownStatus.success).toBe(false);
});
it("ignores unknown top-level fields on tool_call payloads", () => {
// Non-strict protocol: extra top-level keys are stripped, not rejected.
const parsed = AgentTimelineItemPayloadSchema.safeParse({
...canonicalBase(),
status: "running",
error: null,
@@ -72,9 +78,7 @@ describe("shared messages tool_call schema", () => {
output: { exitCode: 0 },
});
expect(missingCallId.success).toBe(false);
expect(unknownStatus.success).toBe(false);
expect(withTopLevelInputOutput.success).toBe(false);
expect(parsed.success).toBe(true);
});
it("rejects legacy status/error combinations without normalization", () => {