Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/agent/test/e2e/agent.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ suite("CoderAgent e2e (live Coder)", () => {
}, 120_000);

it("attaches a file and the model reads its contents", async () => {
// An un-guessable token, so a correct answer proves the model actually read
// the uploaded file (not its own prior knowledge).
const secret = "ZEBRA-7731";
// An un-guessable reference id, so a correct answer proves the model read
// the uploaded file without asking it to disclose confidential information.
const marker = "ZEBRA-7731";
const doc = new TextEncoder().encode(
`# Internal Note\n\nThe access code is ${secret}. Keep it confidential.\n`,
`# Shipment Note\n\nThe reference id for this shipment is ${marker}.\n`,
);
const agent = new CoderAgent({
client,
Expand All @@ -313,14 +313,14 @@ suite("CoderAgent e2e (live Coder)", () => {
{
role: "user",
content: [
{ type: "text", text: "What is the access code in the attached file?" },
{ type: "text", text: "What is the reference id in the attached file?" },
{ type: "file", data: doc, mediaType: "text/markdown", filename: "note.md" },
],
},
],
});
if (agent.chatId) cleanup.push(agent.chatId);

expect(result.text).toContain(secret);
expect(result.text).toContain(marker);
}, 120_000);
});
Loading