fix(agent-framework): restore importability on current agent-framework-core releases#1281
Open
abhay-codes07 wants to merge 1 commit into
Open
Conversation
…k-core The package pins agent-framework-core>=1.0.0rc3 but imports BaseContextProvider, which only existed in the rc series — it was renamed to ContextProvider in 1.0.0 stable. Every version pip resolves today (1.0.0 through 1.11.0) satisfies the pin and lacks the symbol, so a fresh `pip install supermemory-agent-framework` yields a package that cannot even be imported: `from supermemory_agent_framework import ...` raises ImportError via the eager package __init__. The rename is interface-neutral: both classes take __init__(source_id: str) and expose before_run/after_run with byte-identical keyword-only signatures (verified with inspect against 1.0.0rc3 and 1.11.0). Fall back to ContextProvider when BaseContextProvider is absent, keeping rc3 compatibility. Verified by running the full test suite (54 tests) twice in clean venvs: once against agent-framework-core==1.0.0rc3 and once against 1.11.0 — all pass on both.
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.
What
A fresh
pip install supermemory-agent-frameworkproduces a package that cannot be imported.The package pins
agent-framework-core>=1.0.0rc3but importsBaseContextProvider, which only existed in the rc series — it was renamed toContextProviderin 1.0.0 stable. Every version pip resolves today (1.0.0 through 1.11.0) satisfies the pin and lacks the symbol, sofrom supermemory_agent_framework import ...raisesImportErrorthrough the eager package__init__. All six exported classes are unusable.Fix
The rename is interface-neutral — verified with
inspectagainst both 1.0.0rc3 and 1.11.0:__init__(self, source_id: str)— identicalbefore_run/after_run— byte-identical keyword-only signatures (agent,session,context,state)So
context_provider.pynow falls back:which keeps rc3 compatibility while restoring every stable release. The dependency pin is untouched — with this change its declared range is actually honest.
Testing
Ran the full test suite (54 tests) twice in clean venvs:
agent-framework-core==1.0.0rc3+supermemory— 54 passedagent-framework-core==1.11.0+supermemory— 54 passed (collection previously died withImportError: cannot import name 'BaseContextProvider')cc @MaheshtheDev