test(agent-runner): update formatter test for dropped <messages> envelope#2596
Merged
gavrielc merged 1 commit intoMay 23, 2026
Conversation
…lope fe2e881 (nanocoai#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>
Collaborator
|
@IamAdamJowett Thanks for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Update
poll-loop.test.tsso the multi-message formatter test matches the current formatter output.Why
fe2e881b(#2556) dropped the<messages>envelope fromformatChatMessages— multiple chat messages are now emitted as consecutive self-contained<message …>blocks (so the Claude Agent SDK calls the API instead of returning a synthetic "No response requested." stub). The test was never updated and still assertedtoContain('<messages>')/'</messages>', so it has failed on every PR built againstmainsince 2026-05-19.How it works
Assert the current shape instead: no
<messages>envelope, and one<messageblock per message (2 here). Sender assertions are unchanged.How it was tested
bun testincontainer/agent-runner/— full suite now 95 pass / 0 fail (was 94 / 1).🤖 Generated with Claude Code