Skip to content

fix(bedrock): preserve complete calls - #2

Open
calclavia wants to merge 2 commits into
feat/ai-bedrockfrom
fix/bedrock-length-tools
Open

calclavia wants to merge 2 commits into
feat/ai-bedrockfrom
fix/bedrock-length-tools

Conversation

@calclavia

Copy link
Copy Markdown

The published Bedrock adapter drops complete tool calls when the same response ends with max_tokens, even though it emits identical arguments for tool_use. Parse stopped tool blocks at the length terminal with the existing secure parser, preserve complete calls, and retain the original finish reason and usage.

Incomplete, empty, and unsafe argument buffers remain parameter deltas at the length terminal. Normal completion keeps its existing parse-error behavior. This change adds no execution or transport retry policy.

This PR targets feat/ai-bedrock, the source branch whose commit 08590cdf2c matches the published @tardie/ai-bedrock@0.0.1 source. The package is absent from clavia/ai-providers.

Validation: the portable public-layer reproduction fails against the published package and passes with the generated installation patch; all 19 Bedrock provider tests, package TypeScript check, formatting, and repository pnpm check pass. The regression includes complete, partial, unsafe, and empty buffers in one length-completed stream and verifies usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant