From df90f9952c40262a299cba2a5e80bcce22e54221 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 23 May 2026 11:09:42 +1000 Subject: [PATCH] test(agent-runner): update formatter test for dropped envelope fe2e881b (#2556) removed the wrapper from formatChatMessages so the Claude Agent SDK calls the API instead of emitting a synthetic stub, but poll-loop.test.ts still asserted the wrapper. The test has failed on every PR built against main since. Assert the current shape: no envelope, one self-contained block per message. Co-Authored-By: Claude Opus 4.7 (1M context) --- container/agent-runner/src/poll-loop.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/container/agent-runner/src/poll-loop.test.ts b/container/agent-runner/src/poll-loop.test.ts index 29b769bbbac..085cc61df6e 100644 --- a/container/agent-runner/src/poll-loop.test.ts +++ b/container/agent-runner/src/poll-loop.test.ts @@ -37,13 +37,15 @@ describe('formatter', () => { expect(prompt).toContain('Hello world'); }); - it('should format multiple chat messages as XML block', () => { + it('should format multiple chat messages as distinct blocks', () => { insertMessage('m1', 'chat', { sender: 'John', text: 'Hello' }); insertMessage('m2', 'chat', { sender: 'Jane', text: 'Hi there' }); const messages = getPendingMessages(); const prompt = formatMessages(messages); - expect(prompt).toContain(''); - expect(prompt).toContain(''); + // The envelope was dropped in fe2e881b (#2556) so the SDK calls + // the API; each message is now its own self-contained block. + expect(prompt).not.toContain(''); + expect(prompt.match(/