zot/packages
Raymond Gasper fec5ae0bf1 fix(bedrock): inject stub toolConfig when history has tool blocks
Bedrock's Converse API returns HTTP 400 with "toolConfig field must be
defined when using toolUse and toolResult content blocks" whenever the
message history contains toolUse or toolResult blocks but toolConfig is
absent from the request.

The /btw side-chat sends the frozen main transcript as context with no
tools defined. If the main conversation included tool calls the serialised
messages will contain toolUse/toolResult blocks, triggering the 400.

Fix: add bedrockMessagesHaveToolBlocks() to detect this case and, when
req.Tools is empty but tool blocks are present in the history, inject a
minimal stub toolConfig with an inert placeholder tool. Bedrock accepts
the request and the stub can never be invoked since no tool_use stop
reason can fire when the advertised tool list is effectively empty.
2026-06-08 10:56:03 -04:00
..
agent Merge remote-tracking branch 'origin/main' into pr-11 2026-06-08 15:23:22 +02:00
core Retry transient provider stream errors 2026-05-30 15:25:33 +02:00
provider fix(bedrock): inject stub toolConfig when history has tool blocks 2026-06-08 10:56:03 -04:00
tui Word-wrap provider error rows instead of truncating 2026-06-04 19:25:16 +02:00