Skip to content

fix(memory): encode redacted reasoning bytes - #720

Closed
jariy17 wants to merge 1 commit into
mainfrom
fix/memory-redacted-reasoning-bytes
Closed

jariy17 wants to merge 1 commit into
mainfrom
fix/memory-redacted-reasoning-bytes

Conversation

@jariy17

@jariy17 jariy17 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Encode byte values inside preserved reasoning blocks before serializing the OpenAI-format memory payload.
  • Decode those values when restoring the Strands message.
  • Add a regression test proving redactedContent round-trips as bytes.

How

The converter uses Strands' encode_bytes_values before storing preserved reasoning blocks and decode_bytes_values when restoring them. This keeps the payload JSON-safe while returning the original byte value to the model.

Why

Models can return redactedContent as raw bytes. Passing that value to json.dumps raises TypeError, failing the agent turn before the memory event is saved.

Fixes #680

@github-actions github-actions Bot added the size/s PR size: S label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ No Breaking Changes Detected

No public API breaking changes found in this PR.

@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve October 27, 2026 16:53 — with GitHub Actions Active
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Oct 27, 2026
@jariy17 jariy17 closed this Oct 27, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Oct 27, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 27, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 27, 2026

This branch was successfully deployed

1 active deployment
auto-approve — c508cb8c Deployed Oct 27, 2026 by jariy17 via Test (tools) #1667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

1 participant