Skip to content

Commit 55d0d03

Browse files
committed
test(codex): expect canonical assistant text blocks in mirrored history
Session ingest has normalized legacy assistant string content into [{ type: "text" }] blocks since #98908, which updated the core cli-runner session-history analog but missed this extension file. The suite only runs in full local runs and the dispatch-only plugin-prerelease lane, so push/PR CI stayed green while local scripts/pr prepare-gates failed on any OS. refs #99857
1 parent 530f6d8 commit 55d0d03

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎extensions/codex/src/app-server/session-history.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ async function writeSession(records: unknown[]): Promise<string> {
3232
return sessionFile;
3333
}
3434

35+
// Fixtures keep legacy string content on purpose: session ingest normalizes
36+
// assistant strings into [{ type: "text" }] blocks, so expectations below
37+
// assert the canonical block-array shape for assistant rows.
3538
function messageEntry(params: {
3639
id: string;
3740
parentId: string | null;
@@ -87,7 +90,7 @@ describe("readCodexMirroredSessionHistoryMessages", () => {
8790
readCodexMirroredSessionHistoryMessages(mirroredTarget(sessionFile)),
8891
).resolves.toMatchObject([
8992
{ role: "user", content: "root prompt" },
90-
{ role: "assistant", content: "active answer" },
93+
{ role: "assistant", content: [{ type: "text", text: "active answer" }] },
9194
]);
9295
});
9396

@@ -141,7 +144,7 @@ describe("readCodexMirroredSessionHistoryMessages", () => {
141144
readCodexMirroredSessionHistoryMessages(mirroredTarget(sessionFile)),
142145
).resolves.toMatchObject([
143146
{ role: "user", content: "visible prompt" },
144-
{ role: "assistant", content: "continued answer" },
147+
{ role: "assistant", content: [{ type: "text", text: "continued answer" }] },
145148
]);
146149
});
147150

@@ -172,7 +175,7 @@ describe("readCodexMirroredSessionHistoryMessages", () => {
172175
readCodexMirroredSessionHistoryMessages(mirroredTarget(sessionFile)),
173176
).resolves.toMatchObject([
174177
{ role: "user", content: "visible prompt" },
175-
{ role: "assistant", content: "continued answer" },
178+
{ role: "assistant", content: [{ type: "text", text: "continued answer" }] },
176179
]);
177180
});
178181
});

0 commit comments

Comments
 (0)