Skip to content

refactor(sdk)!: remove deprecated backend compatibility shims#4541

Open
Mason Daugherty (mdrxy) wants to merge 10 commits into
mainfrom
mdrxy/sdk/cleanup-removal
Open

refactor(sdk)!: remove deprecated backend compatibility shims#4541
Mason Daugherty (mdrxy) wants to merge 10 commits into
mainfrom
mdrxy/sdk/cleanup-removal

Conversation

@mdrxy

@mdrxy Mason Daugherty (mdrxy) commented Jul 7, 2026

Copy link
Copy Markdown
Member

Deprecated backend compatibility paths and their related legacy symbols are now removed. Users should pass backend instances instead of callable factories, configure StoreBackend with an explicit namespace, rely on string FileData.content, and use the current ls / glob / grep / ReadResult APIs. The deprecated runtime parameters on StateBackend and StoreBackend are removed, along with the compatibility symbols BackendFactory, BACKEND_TYPES, FileFormat, and Unset.


Removes expired SDK compatibility paths and related legacy storage controls, so backend APIs now use the current storage and middleware contracts directly. This tightens the public surface around BackendProtocol instances, explicit StoreBackend namespaces, modern file data storage, and virtual filesystem defaults.

Changes

  • Backend construction: removes callable backend factories across create_deep_agent and SDK middleware; callers now pass concrete BackendProtocol instances. The BackendFactory and BACKEND_TYPES aliases are also removed.
  • Backend constructors: removes the deprecated runtime parameters from StateBackend and StoreBackend.
  • Backend protocol cleanup: drops deprecated files_update fields and their Unset sentinel, legacy ls_info / glob_info / grep_raw shims, and plain-string read() compatibility.
  • File storage format: removes v1 list[str] content handling, the FileFormat alias, and file_format knobs; FileData.content is now treated as a string-only storage field.
  • Persistent store behavior: requires explicit StoreBackend(namespace=...), removes BackendContext, and removes legacy assistant-id namespace fallback.
  • Filesystem defaults: makes FilesystemBackend and LocalShellBackend default to virtual_mode=True without the old migration warning.
  • Summarization history: removes deprecated history_path_prefix and uses the configured backend instance directly for conversation-history offloading.

@github-actions github-actions Bot added breaking Breaking change! deepagents Related to the `deepagents` SDK / agent harness internal User is a member of the `langchain-ai` GitHub organization refactor Code change that neither fixes a bug nor adds a feature size: XL 1000+ LOC labels Jul 7, 2026

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 2 potential issues.

Open in WebView Open SWE trace

self,
runtime: object = None,
*,
namespace: NamespaceFactory,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 StoreBackend signature breaks eval test

Making namespace mandatory leaves at least one in-repo call site broken: libs/evals/tests/evals/test_memory.py still constructs StoreBackend(store=store) for the composite memory backend. That test now raises TypeError: StoreBackend.__init__() missing 1 required keyword-only argument: 'namespace' before the agent is built. Please update that caller (and its seeded store value) along with the SDK tests so the eval suite can still run against this API change.

(Refers to line 102)


Your feedback helps Open SWE learn. React with 👍 or 👎 to tell us if this review comment was useful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore for now

Comment thread libs/deepagents/deepagents/backends/store.py
@mdrxy

Copy link
Copy Markdown
Member Author

TODO (follow-up PR): update libs/evals/tests/evals/test_memory.py for the removed StoreBackend compatibility paths.

The eval still constructs StoreBackend(store=store) without the now-required namespace, and seeds the store with legacy list[str] content. To keep eval-package changes outside this SDK cleanup PR, a follow-up should:

  • pass an explicit namespace factory to StoreBackend
  • seed current-format FileData with string content and an encoding

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jul 13, 2026
@mdrxy

Mason Daugherty (mdrxy) commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

Open question: how should we handle FileFormat and the public file_format= parameters here?

The v1 list[str] storage behavior was deprecated, so removing v1 itself was signaled. However, the FileFormat alias and the file_format= parameters on StateBackend and StoreBackend were not directly deprecated and emitted no warning. Users could reasonably expect v1 to disappear without expecting the alias and parameters to be removed entirely.

Should we:

  • keep the current removal for 0.7;
  • restore the alias and parameters for one deprecation cycle, potentially accepting only "v2"; or
  • take another compatibility approach?

BackendFactory, BACKEND_TYPES, and Unset seem more directly inferable as collateral removals of their explicitly deprecated factory and files_update paths, so FileFormat is the uncertain case.

…oval

# Conflicts:
#	libs/deepagents/deepagents/backends/protocol.py
#	libs/deepagents/tests/unit_tests/backends/test_protocol.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change! deepagents Related to the `deepagents` SDK / agent harness dependencies Pull requests that update a dependency file internal User is a member of the `langchain-ai` GitHub organization refactor Code change that neither fixes a bug nor adds a feature size: XL 1000+ LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant