This repository was archived by the owner on Jun 3, 2026. It is now read-only.
Task 3.3: Implement Tool Result Status Auto-Detection for BedrockModelProvider Implementation#89
Merged
Conversation
- Add includeToolResultStatus config option supporting 'auto' | boolean - Implement auto-detection logic to check model ID patterns - Add MODELS_INCLUDE_STATUS constant with Claude model pattern - Update _formatContentBlock to conditionally include status field - Add _shouldIncludeToolResultStatus private method with debug logging - Add 8 comprehensive unit tests covering all configuration modes - Default behavior is 'auto' mode which detects based on model ID Resolves: #24
afarntrog
commented
Oct 29, 2025
Contributor
Author
|
/strands address the comment #89 (comment) |
Use cleaner single-return pattern with conditional property spreading instead of separate if/else return statements for better readability.
afarntrog
commented
Oct 29, 2025
Contributor
Author
|
/strands address the comment #89 (comment) |
Removed duplicate test case that was testing non-Claude model behavior in 'auto' mode. This is already covered by the undefined/default tests.
Unshure
reviewed
Oct 29, 2025
Contributor
Author
|
/strands address the following 2 comments:
|
- Remove generic @see link from includeToolResultStatus config - Add specific AWS API reference to MODELS_INCLUDE_STATUS constant - Document that status field is only supported by Claude models per AWS docs Reference: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolResultBlock.html
Unshure
reviewed
Oct 29, 2025
Contributor
Author
- Change console.log to console.debug for auto-detection logging - Remove redundant 'follows auto logic for Claude models' test in undefined section - Update debug logging tests to spy on console.debug instead of console.log - Test count reduced from 44 to 43 tests (all passing)
Unshure
reviewed
Oct 29, 2025
Contributor
Author
|
/strands address this comment #89 (comment) |
Remove debug logging test cases as they are overkill. The console.debug calls still exist in the implementation for debugging purposes. Test count reduced from 43 to 41 tests (all passing).
Unshure
approved these changes
Oct 29, 2025
dbschmigelski
pushed a commit
to dbschmigelski/sdk-typescript
that referenced
this pull request
Feb 5, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Overview
Implements dynamic logic to automatically determine whether to include the
statusfield in tool results based on the Bedrock model ID, matching the Python SDK's auto-detection behavior.Resolves: #24
Changes
Interface and Configuration
includeToolResultStatus?: 'auto' | booleantoBedrockModelConfiginterfaceMODELS_INCLUDE_STATUSconstant array with Claude model patternImplementation
_shouldIncludeToolResultStatus()private method with:_formatContentBlock()method to conditionally include status field based on detection resultTesting
trueconfiguration (always includes status)falseconfiguration (never includes status)'auto'mode with Claude models (includes status)'auto'mode with non-Claude models (excludes status)undefined(default) with Claude models (includes status)undefined(default) with non-Claude models (excludes status)Implementation Notes
Model Pattern Matching
.includes()to detect Claude models'anthropic.claude'matches all Claude model variantsglobal.anthropic.claude-sonnet-4-5-20250929-v1:0) correctly matches and includes statusType Safety
Integration Tests
Integration tests for tool result formatting would require complex multi-turn tool invocation cycles. The comprehensive unit tests verify the formatting logic for all configuration modes and validate that the output matches the Bedrock API specification.
Exit Criteria
includeToolResultStatusconfig option supports'auto' | boolean'auto'(via?? 'auto'in the method)