Skip to content

wip(api): normalize snake_case/camelCase in passthrough methods to boto. #338

Draft
Hweinstock wants to merge 2 commits intoaws:mainfrom
Hweinstock:fix/snake-case-passthrough-v2
Draft

wip(api): normalize snake_case/camelCase in passthrough methods to boto. #338
Hweinstock wants to merge 2 commits intoaws:mainfrom
Hweinstock:fix/snake-case-passthrough-v2

Conversation

@Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented Mar 13, 2026

built on #335

*Issue #, if available:*#336

Description of changes:

Problem

MemoryClient and MemorySessionManager expose some methods via __getattr__ passthrough to boto3, which requires camelCase kwargs (memoryId, clientToken), while explicit SDK methods accept snake_case (memory_id,
client_token). Users have no way to know which convention to use without reading the source.

See attached issue for an example.

Solution

  • Leverage a middleware layer to accept both conventions.
  • camelCase still works (backward compat), snake_case is converted to camelCase before forwarding to boto3.
  • Passing both forms for the same param (e.g. memory_id and memoryId) raises TypeError. Malformed snake_case (e.g. a__b, _private) is rejected with ValueError.
  • provide minimal validation of snake_case input to avoid accepting bad input.

Follows the existing __getattr__ pattern — no new public API surface.

Testing

  • unit tests
  • 1 integ test updated to use snake_case for update_memory passthrough (e2e verification)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Hweinstock Hweinstock changed the title Fix/snake case passthrough v2 wip(api): normalize snake_case/camelCase in passthrough methods to boto. Mar 13, 2026
@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 98.96373% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@11e2ac5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/bedrock_agentcore/memory/client.py 87.50% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #338   +/-   ##
=======================================
  Coverage        ?   90.96%           
=======================================
  Files           ?       44           
  Lines           ?     4096           
  Branches        ?      628           
=======================================
  Hits            ?     3726           
  Misses          ?      203           
  Partials        ?      167           
Flag Coverage Δ
unittests 90.96% <98.96%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants