GHHG10/CodeServer / opencode /packages /core /test /session-compaction.test.ts
GHHG10's picture
download
raw
623 Bytes
import { expect, test } from "bun:test"
import { SessionCompaction } from "@opencode-ai/core/session/compaction"
test("compaction describes tool media without embedding base64", () => {
const base64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
const serialized = SessionCompaction.serializeToolContent([
{ type: "text", text: "Image read successfully" },
{
type: "file",
uri: `data:image/png;base64,${base64}`,
mime: "image/png",
name: "pixel.png",
},
])
expect(serialized).toBe("Image read successfully\n[Attached image/png: pixel.png]")
expect(serialized).not.toContain(base64)
})

Xet Storage Details

Size:
623 Bytes
·
Xet hash:
17d13485cc8b5ece48a30e9759dfa976da376167f10a54f31660cd36e4ed1415

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.