Skip to content

Commit 4d92b6d

Browse files
authored
Merge pull request #2596 from IamAdamJowett/fix/formatter-test-drop-messages-envelope
test(agent-runner): update formatter test for dropped <messages> envelope
2 parents 136cb4d + df90f99 commit 4d92b6d

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)