Skip to content

fix(memory): defer state mutation in add_provider until schema load succeeds#13224

Open
Magicray1217 wants to merge 1 commit into
NousResearch:mainfrom
Magicray1217:fix/issue-9948-memory-provider-add
Open

fix(memory): defer state mutation in add_provider until schema load succeeds#13224
Magicray1217 wants to merge 1 commit into
NousResearch:mainfrom
Magicray1217:fix/issue-9948-memory-provider-add

Conversation

@Magicray1217

Copy link
Copy Markdown

Problem\n\nMemoryManager.add_provider() mutates internal state (_has_external = True and appends provider to _providers) BEFORE provider.get_tool_schemas() succeeds. If get_tool_schemas() raises, the manager is left in a poisoned half-registered state.\n\n## Fix\n\n- Call get_tool_schemas() first in a try/except\n- Only mutate _has_external and _providers after successful schema load\n- Reuse the loaded schemas list instead of calling get_tool_schemas() redundantly\n\nFixes #9948

…ucceeds. Fixes NousResearch#9948

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/memory Memory tool and memory providers labels Apr 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #10051 and #9997 — all three fix the same #9948 bug (add_provider state mutation before schema load). Maintainers should pick one.

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

Labels

P2 Medium — degraded but workaround exists tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants