Skip to content

Commit df90f99

Browse files
Adamclaude
andcommitted
test(agent-runner): update formatter test for dropped <messages> envelope
fe2e881 (#2556) removed the <messages> 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 <message> block per message. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 68448c4 commit df90f99

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

container/agent-runner/src/poll-loop.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ describe('formatter', () => {
3737
expect(prompt).toContain('Hello world');
3838
});
3939

40-
it('should format multiple chat messages as XML block', () => {
40+
it('should format multiple chat messages as distinct <message> blocks', () => {
4141
insertMessage('m1', 'chat', { sender: 'John', text: 'Hello' });
4242
insertMessage('m2', 'chat', { sender: 'Jane', text: 'Hi there' });
4343
const messages = getPendingMessages();
4444
const prompt = formatMessages(messages);
45-
expect(prompt).toContain('<messages>');
46-
expect(prompt).toContain('</messages>');
45+
// The <messages> envelope was dropped in fe2e881b (#2556) so the SDK calls
46+
// the API; each message is now its own self-contained <message> block.
47+
expect(prompt).not.toContain('<messages>');
48+
expect(prompt.match(/<message /g) ?? []).toHaveLength(2);
4749
expect(prompt).toContain('sender="John"');
4850
expect(prompt).toContain('sender="Jane"');
4951
});

0 commit comments

Comments
 (0)