# Changelog — 2026-03-31 #02 ## Comprehensive test suite and bug fixes ### Tests Added - **structs_spec.rb**: Added struct equality tests (same values equal, different values not equal) - **errors_spec.rb**: Added StandardError inheritance test, rescue-as-StandardError test, RateLimitError retry_after default, rescue-as-Error test - **copilot_spec.rb**: Added tests for: - VERSION constant accessibility - Multiple tool calls in a single response - Empty tools array omits `tools` key from request body - TextBlock array in user messages converted to string content - ToolResultBlock with array content (Array of TextBlocks) - ToolResultBlock with is_error: true - finish_reason "length" maps to :max_tokens stop_reason - Assistant message containing mixed text + tool_use blocks - Streaming usage data capture - Multiple parallel tool calls in streaming - Copilot token caching (reuses token, only 1 token request for 2 chats) - Authentication failure on Copilot token exchange ### Bug Fixes - **copilot.rb**: Fixed `Array(hash)` bug in `build_wire_messages` — `Array()` on a Hash converts it to key-value pairs instead of wrapping in an array. Replaced with explicit `is_a?(Array)` check. - **copilot.rb**: Fixed empty argument fragment yielding in streaming — empty string arguments from initial tool_call chunks were being yielded as `tool_use_delta` events. Added `next if arg_frag.empty?` guard. ### Total Test Count 84 examples, 0 failures across 4 spec files.