Skip to content

fix(agent-framework): restore importability on current agent-framework-core releases#1281

Open
abhay-codes07 wants to merge 1 commit into
supermemoryai:mainfrom
abhay-codes07:fix/agent-framework-import-compat
Open

fix(agent-framework): restore importability on current agent-framework-core releases#1281
abhay-codes07 wants to merge 1 commit into
supermemoryai:mainfrom
abhay-codes07:fix/agent-framework-import-compat

Conversation

@abhay-codes07

Copy link
Copy Markdown
Contributor

What

A fresh pip install supermemory-agent-framework produces a package that cannot be imported.

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 from supermemory_agent_framework import ... raises ImportError through the eager package __init__. All six exported classes are unusable.

Fix

The rename is interface-neutral — verified with inspect against both 1.0.0rc3 and 1.11.0:

  • __init__(self, source_id: str) — identical
  • before_run / after_run — byte-identical keyword-only signatures (agent, session, context, state)

So context_provider.py now falls back:

try:
    from agent_framework import BaseContextProvider
except ImportError:
    from agent_framework import ContextProvider as BaseContextProvider

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 passed
  • agent-framework-core==1.11.0 + supermemory — 54 passed (collection previously died with ImportError: cannot import name 'BaseContextProvider')

cc @MaheshtheDev

…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.
Copilot AI review requested due to automatic review settings July 13, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants