[PR #196] [MERGED] fix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks #226

Closed
opened 2026-06-06 22:09:47 -04:00 by yindo · 0 comments
Owner

📋 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_releaseHead: fix/bedrock-tool-config


📝 Commits (2)

  • db82dde fix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks
  • 281910e Merge 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 toolConfig is always present in the Bedrock Converse API request when the message history contains toolUse or toolResult content blocks.

Fixes #160

Root Cause

The Bedrock Converse API requires toolConfig to be defined whenever a request or its history contains toolUse/toolResult blocks. The provider was only including toolConfig when new tool definitions were being added for the current turn, omitting it when tools were already embedded in history. This produced:

ValidationException: The toolConfig field must be defined when using toolUse
and toolResult content blocks.

Changes

  • Bedrock provider: Before sending the Converse request, scans the message chain for any toolUse/toolResult blocks. If found and toolConfig is nil/empty, injects a minimal toolConfig with 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.

## 📋 Pull Request Information **Original PR:** https://github.com/vxcontrol/pentagi/pull/196 **Author:** [@manusjs](https://github.com/manusjs) **Created:** 3/11/2026 **Status:** ✅ Merged **Merged:** 3/20/2026 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `feature/next_release` ← **Head:** `fix/bedrock-tool-config` --- ### 📝 Commits (2) - [`db82dde`](https://github.com/vxcontrol/pentagi/commit/db82dde7e618ffe342446f5ce85d252473a36808) fix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks - [`281910e`](https://github.com/vxcontrol/pentagi/commit/281910e0fd007f114c40de581201d188d21e5b80) Merge branch 'feature/next_release' into fix/bedrock-tool-config ### 📊 Changes **1 file changed** (+114 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/pkg/providers/bedrock/bedrock_test.go` (+114 -0) </details> ### 📄 Description ## What Ensures `toolConfig` is always present in the Bedrock Converse API request when the message history contains `toolUse` or `toolResult` content blocks. Fixes #160 ## Root Cause The Bedrock Converse API requires `toolConfig` to be defined whenever a request or its history contains `toolUse`/`toolResult` blocks. The provider was only including `toolConfig` when new tool definitions were being added for the current turn, omitting it when tools were already embedded in history. This produced: ``` ValidationException: The toolConfig field must be defined when using toolUse and toolResult content blocks. ``` ## Changes - **Bedrock provider**: Before sending the Converse request, scans the message chain for any `toolUse`/`toolResult` blocks. If found and `toolConfig` is nil/empty, injects a minimal `toolConfig` with 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-06 22:09:47 -04:00
yindo closed this issue 2026-06-06 22:09:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#226