Skip to content

Commit 020b56d

Browse files
committed
test(runner): import the cold-frame label instead of duplicating it
1 parent 208fb31 commit 020b56d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

services/runner/tests/unit/attachment-prompt-blocks.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
collectLegacyInlineImages,
88
type ResolvedAttachment,
99
} from "../../src/engines/sandbox_agent/attachments.ts";
10+
import { COLD_FRAME_USER_LABEL } from "../../src/engines/sandbox_agent/transcript.ts";
1011
import type { ChatMessage } from "../../src/protocol.ts";
1112

1213
const ATTACHMENT_ID = "019a52c2-14c0-7c14-b874-2f5798f9cd21";
@@ -72,7 +73,8 @@ describe("attachment prompt blocks", () => {
7273
it("places mentions in the latest-user section of a cold replay frame", () => {
7374
const turnText =
7475
"Conversation so far:\nassistant: ready\n\n" +
75-
"Continue the conversation. The user now says:\ndescribe this";
76+
COLD_FRAME_USER_LABEL +
77+
"describe this";
7678
const blocks = buildPromptBlocks(
7779
turnText,
7880
[resolved("workspace_only")],
@@ -84,7 +86,7 @@ describe("attachment prompt blocks", () => {
8486
assert.equal(
8587
text,
8688
"Conversation so far:\nassistant: ready\n\n" +
87-
"Continue the conversation. The user now says:\n" +
89+
COLD_FRAME_USER_LABEL +
8890
"[attached file: photo.png at attachments/" +
8991
ATTACHMENT_ID +
9092
"/photo.png]\ndescribe this",
@@ -93,8 +95,7 @@ describe("attachment prompt blocks", () => {
9395

9496
it("puts attachment-only mentions after the cold frame's closing label", () => {
9597
const turnText =
96-
"Conversation so far:\nassistant: ready\n\n" +
97-
"Continue the conversation. The user now says:\n";
98+
"Conversation so far:\nassistant: ready\n\n" + COLD_FRAME_USER_LABEL;
9899
const blocks = buildPromptBlocks(
99100
turnText,
100101
[resolved("workspace_only")],

0 commit comments

Comments
 (0)