8 months ago
e703e1bAdd comprehensive tests covering multi-step tool loops, stream part forwarding, abort/error handling, MCP cleanup, and usage reporting. Three new test files were introduced: test/agent.toolloop.test.ts (unit tests for createRunTurn behavior and stream handling), test/server.toolstream.test.ts (end-to-end WebSocket server tests ensuring model_stream_chunk ordering and turn usage/events), and test/session.stream-pipeline.test.ts (session pipeline tests mapping SDK stream parts to server protocol chunks). Tests include helpers and mocks for streamText, MCP tooling, observability, and runTurn to validate ordering, indices, rawPart forwarding, and edge cases.
Parente7a2623