aws / aws/bedrock-agentcore-sdk-python

[BUG] filter_restored_tool_context is incompatible with extended thinking

Open
#621 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
761
Forks
147
Avg merge
1d 23h
Merged PRs (30d)
7

Description

### Version

`bedrock-agentcore` 1.19.0

### Model

Claude Sonnet 4.6 via Amazon Bedrock, with extended thinking enabled (`{"type": "adaptive", "display": "summarized"}`)

### What happens

Setting `filter_restored_tool_context=True` on `AgentCoreMemoryConfig` makes every request fail once there is history to restore:

```
ValidationException: messages.1.content.6: `thinking` or `redacted_thinking` blocks in
the latest assistant message cannot be modified. These blocks must remain as they were
in the original response.
```

The option is unusable for any agent with extended thinking enabled. Turning the flag off restores normal operation.

### Expected

Either the option works alongside extended thinking, or the incompatibility is documented and the flag rejected at configuration time rather than failing on every request at runtime.

### Context

We hit this while trying to work around https://github.com/strands-agents/harness-sdk/issues/3651, where an interrupted turn leaves a session permanently unusable.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with bedrock-agentcore 1.19.0 using AgentCoreMemoryConfig(filter_restored_tool_context=True), restored history, and Claude extended thinking. Trace the configuration and restored-message handling, then verify that the option either works with thinking blocks or is rejected at configuration time with documented guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
ai, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.