Conversation
commit: |
… metrics (closes #165) Remove spurious Claude Messages API type fields from converse-stream delta and start events. Use reasoningContent format for thinking blocks. Forward inferenceConfig.maxTokens in request conversion. Add metrics field to non-streaming converse responses.
Negative assertions on delta and start payloads (not.toHaveProperty type). Reasoning tests use reasoningContent format. maxTokens forwarding test. Non-streaming metrics assertions.
… SDK shapes New drift test for invoke-with-response-stream binary framing and Anthropic-native event shapes. SDK shapes for converse-stream tool call and reasoning variants. Three-way triangulate comparisons.
3a3418b to
1e57275
Compare
84c6264 to
8b242bc
Compare
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.
Summary
Converse-stream spec conformance fixes — same class of bugs as #162 (Claude Messages API format leaking into Converse API handlers). Full 10-agent Bedrock conformance audit completed; all other Bedrock endpoints are clean.
Fixes
contentBlockDelta spurious
typefield —deltaobjects contained Claude Messages APItypefields (text_delta,thinking_delta) not valid in the Converse API's tagged union. botocore's single-member parser rejected the extra field withResponseParserError. (Closes Bug: converse-stream contentBlockDelta.delta contains invalidtypefield, causing ResponseParserError #165)Reasoning events used Claude format —
contentBlockStartusedstart: { type: "thinking" }and deltas useddelta: { thinking: "..." }. Now uses Converse format:start: { reasoningContent: {} }anddelta: { reasoningContent: { text: "..." } }.Text contentBlockStart had spurious
type—start: { type: "text" }changed tostart: {}(Converse text blocks have empty start).inferenceConfig.maxTokenssilently dropped —converseToCompletionRequestnow forwardsmaxTokenstomax_tokens.Non-streaming converse missing
metrics— Addedmetrics: { latencyMs: 0 }to all 3 non-streaming response builders, matching the streaming path and AWS ConverseResponse spec.New drift tests
toolUsestart/delta SDK shapes + triangulatereasoningContentstart/delta SDK shapes + triangulateAudit scope
10-agent MSAL covering: invoke non-streaming, invoke-stream binary framing, invoke-stream Claude events, converse non-streaming, converse-stream text/tool/reasoning, converse request conversion, invoke request conversion, drift test + SDK shape coverage. All clean except the 5 issues above.
Closes #165 — reported by @KMiya84377
Test plan
pnpm test— 2837 passednpx tsc --noEmit— clean