mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[PR #196] [MERGED] fix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks #226
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/196
Author: @manusjs
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/20/2026
Merged by: @asdek
Base:
feature/next_release← Head:fix/bedrock-tool-config📝 Commits (2)
db82ddefix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks281910eMerge branch 'feature/next_release' into fix/bedrock-tool-config📊 Changes
1 file changed (+114 additions, -0 deletions)
View changed files
📝
backend/pkg/providers/bedrock/bedrock_test.go(+114 -0)📄 Description
What
Ensures
toolConfigis always present in the Bedrock Converse API request when the message history containstoolUseortoolResultcontent blocks.Fixes #160
Root Cause
The Bedrock Converse API requires
toolConfigto be defined whenever a request or its history containstoolUse/toolResultblocks. The provider was only includingtoolConfigwhen new tool definitions were being added for the current turn, omitting it when tools were already embedded in history. This produced:Changes
toolUse/toolResultblocks. If found andtoolConfigis nil/empty, injects a minimaltoolConfigwith the tools referenced in the chain.bedrock_test.go: 4 new subtests — nil tools with tool-containing chain, empty tools slice with tool-containing chain, tools already set (no change), no tool blocks (no injection).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.