fix: mark internal memory functions as private#2817
Merged
opieter-aws merged 1 commit intoJun 16, 2026
Merged
Conversation
Contributor
|
Assessment: Approve A tidy, low-risk consistency refactor that brings the memory/injection internals in line with the SDK's established privacy conventions ( Verification performed
Nicely scoped and easy to verify — thanks for closing out the nits while the cost is low. |
JackYPCOnline
approved these changes
Jun 16, 2026
9 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Follow-up that closes two non-blocking consistency nits left on the memory PRs (#2811, #2797).
Both were flagged as "fine to merge as-is" by reviewers; this brings the code in line with the
repo's own privacy conventions now, while the surface is young and renaming is cheap — once
released, a module path or symbol can quietly become load-bearing for a downstream user.
1. The lone public symbol in an otherwise-private module (#2811).
resolve_extraction_config.pyexposes a private type (_ResolvedExtractionConfig) and a privatefunction (
_resolve_extraction_config), but the module's default-cadence constant was public.It's referenced only within its own module and test, so it should be private too:
DEFAULT_EXTRACTION_TRIGGER_TURNS→_DEFAULT_EXTRACTION_TRIGGER_TURNS. This matches theprevailing
_DEFAULT_*convention across the SDK (e.g.context_injector/plugin.py's_DEFAULT_NAME,multiagent/graph.py's_DEFAULT_GRAPH_ID). The TS sibling still exports itsconstant because it's used across files there; the Python one isn't, so privatizing is the
locally-correct call.
2. Internal module files that read as public paths (#2797).
The
injectionpackage underscored its functions but not its module files, sofrom strands.injection import message_injectionstill worked and exposed the internals with nonamespace-level "private" signal. The repo convention is to underscore the module itself
(
event_loop/_retry.py,models/_defaults.py,strands/_async.py). This renames the twointernal delivery modules to match:
injection/message_injection.py→injection/_message_injection.pyinjection/xml.py→injection/_xml.pyThe three importers (
memory/memory_manager.py,vended_plugins/context_injector/plugin.py, andthe injection test) and the
injection/__init__.pydocstring reference are updated accordingly.The package's exported
__all__surface is unchanged — only the internal module paths move.Related Issues
Follow-up to #2811 and #2797.
Documentation PR
N/A — no public API or documented behavior changes.
Type of Change
Other (please describe): internal refactor for naming/privacy consistency — no behavior or public
API change.
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce new warnings.
hatch run preparehatch run preparepasses clean (3598 passed, 4 skipped). Also confirmed the privacy boundaryholds:
from strands.injection import _message_injection, _xmlimports, whileimport strands.injection.message_injectionnow raisesModuleNotFoundError.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.