Skip to content

[FEATURE] Deprecate the message-log session managers once snapshot parity and a migration path land #3664

Description

@strandly-the-agent

SDK Language

Python

Problem Statement

Python now ships two session systems: the new snapshot-based SnapshotSessionManager (#3283) and the older message-log managers (FileSessionManager, S3SessionManager, RepositorySessionManager). Keeping both indefinitely means two on-disk formats, two code paths to maintain and test, and no clear answer to "which session manager should I use?".

The intent is to converge on snapshots, but deprecation cannot happen yet — the legacy managers are still the only option for three supported workloads:

Workload Snapshot manager today Legacy manager
Single agent supported supported
Graph / Swarm raises NotImplementedError (_reject_multi_agent) supported (repository_session_manager.py:321,330)
BidiAgent (bidirectional streaming) raises NotImplementedError (_reject_bidi_agent) supported (repository_session_manager.py:351,410,429)
Existing sessions no migration path (#3663) n/a

This is not hypothetical: an earlier revision of #3283 did add @deprecated to all three legacy managers, and it was reverted precisely because the replacement covered neither orchestrators nor Bidi nor existing sessions — a warning telling users to migrate to an API that silently persists nothing for their workload is worse than no warning.

Proposed Solution

Treat this as the gated follow-up. Deprecate only once every workload the legacy managers serve has a supported replacement and a migration path:

Then, per team/FEATURE_LIFECYCLE.md:

  • Apply the @deprecated decorator (not a bare warnings.warn in __init__) so the deprecation surfaces to type checkers and IDEs, with a message naming the replacement and linking the migration guide.
  • State the removal version explicitly (next major), keeping the classes fully functional until then.
  • Update the changelog and the session-management docs, and file the removal as a tracked task against that major.

If Bidi is intentionally excluded, the deprecation message should say which usage is superseded rather than deprecating the class outright.

Use Case

  • A new user reads the session docs and gets exactly one recommended answer instead of two overlapping systems.
  • An existing user upgrading gets a warning that points at a replacement which actually supports their workload, plus a migration procedure that preserves their sessions.
  • Maintainers get to delete a format and its test matrix at the next major instead of carrying both indefinitely.

Alternatives Solutions

  • Keep both indefinitely. No migration burden on users, but permanent double maintenance and a persistent "which one?" question.
  • Docs-only soft deprecation first — mark the message-log managers as legacy in the guide and recommend snapshots for new code, without runtime warnings. This is a reasonable intermediate step that could land as soon as the docs exist, ahead of the full gate.
  • Deprecate only for the single-agent case — scope the guidance to the usage that is genuinely superseded and leave the classes undeprecated for orchestrators/Bidi. Lower risk, but a partial deprecation is harder to communicate.

Additional Context

When this does land it is a user-visible deprecation and eventually a breaking removal, so it warrants the API bar-raising process and a changelog entry, and the removal itself should be scheduled against a major version rather than a minor.

References

Recommended labels (the triage label declared by the issue template does not exist in this repo, so none were applied): enhancement, python, area-sessions, area-persistence, breaking change.

Activity

  1. added
    pythonPull requests that update python code
    area-sessionsRelated to session or session managment
    area-persistenceSession management or checkpointing
    enhancementNew feature or request
    on Aug 5, 2026
  2. opieter-aws commented on Sep 25, 2026

    @opieter-aws
    Contributor

    BiDi is being worked on as part of #4603

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

Metadata

Metadata

Labels

area-persistenceSession management or checkpointingarea-sessionsRelated to session or session managmentenhancementNew feature or requestpythonPull requests that update python code

Fields

Language

Python

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions