Skip to content

feat(session)!: deprecate the message-log session managers - #4832

Closed
nicolas-m-romero wants to merge 2 commits into
mainfrom
agent-tasks/3664-deprecate-message-log-managers
Closed

nicolas-m-romero wants to merge 2 commits into
mainfrom
agent-tasks/3664-deprecate-message-log-managers

Conversation

@nicolas-m-romero

Copy link
Copy Markdown
Contributor

Draft — do not merge yet. Gated follow-up to the migration docs (#4797). The @deprecated message links the migration guide added there, so this should land only after that guide is merged and the deprecation gate in #3664 is agreed.

Summary

Applies the @deprecated decorator (from typing_extensions, per team/FEATURE_LIFECYCLE.md) to the three Python message-log session managers, steering users to SnapshotSessionManager:

  • FileSessionManager → SnapshotSessionManager + LocalFileStorage
  • S3SessionManager → SnapshotSessionManager + S3Storage
  • RepositorySessionManager → SnapshotSessionManager + a custom Storage backend

Each message names the removal version (v2.0.0), the replacement, and links the migration guide:
https://strandsagents.com/docs/user-guide/sdk/agents/session-management/#migrating-from-the-message-log-session-managers

The classes remain fully functional until removal — this only adds the warning + type-checker/IDE signal.

Why now / the gate

The migration gate in #3664 required: multi-agent snapshot support (done, #3662), BidiAgent support (done, #4603), and a migration path (#3663, now a documented procedure in #4797). With those in place the legacy managers can be deprecated.

Implementation notes

  • Decorator message is a string literal (PEP 702 checkers only honor @deprecated with a literal), matching the LlamaAPIModel / make_bash precedents.
  • Decorating the base RepositorySessionManager and its subclasses does not double-warn on instantiation: instantiating a subclass emits only its own message (verified). The base decorator fires once at subclass-definition (import) time, which marks the base for type checkers.
  • Added one deprecation-warning test per manager (pytest.warns(DeprecationWarning, ...)), mirroring test__init__emits_deprecation_warning for LlamaAPIModel.
  • Existing functional tests still construct these managers and now emit a DeprecationWarning; there is no filterwarnings=error, so the suite stays green.

Testing

  • ruff check on the three source files: clean.
  • Python session suite + multiagent graph/swarm (which build these managers): 414 passed, warnings emitted but non-fatal; the 3 new deprecation tests pass.
  • TS build + suite via pre-commit: 4802 passed, no type errors.

Toward #3664.
Depends on #4797 (migration guide the deprecation message links).

@github-actions github-actions Bot added python Pull requests that update python code area-sessions Related to session or session managment area-persistence Session management or checkpointing enhancement New feature or request size/s labels Oct 2, 2026
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@nicolas-m-romero
nicolas-m-romero force-pushed the agent-tasks/3664-deprecate-message-log-managers branch from 2ae090e to ff78869 Compare October 6, 2026 14:43
Apply @deprecated (typing_extensions) to FileSessionManager, S3SessionManager,
and RepositorySessionManager, directing users to SnapshotSessionManager with the
matching Storage backend and linking the migration guide. Message names the
removal version (v2.0.0) per team/FEATURE_LIFECYCLE.md, and the classes remain
fully functional until then.

Adds one deprecation-warning test per manager (mirrors the LlamaAPIModel
pattern). Existing functional tests continue to construct the managers and now
emit a DeprecationWarning; the suite has no filterwarnings=error so they pass.

Gated follow-up to the migration docs (#4797). Depends on the migration guide
landing so the @deprecated link resolves.

Toward #3664.
@nicolas-m-romero
nicolas-m-romero force-pushed the agent-tasks/3664-deprecate-message-log-managers branch from ff78869 to 992a779 Compare October 6, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-persistence Session management or checkpointing area-sessions Related to session or session managment enhancement New feature or request python Pull requests that update python code size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant