Skip to content

fix(agent): route memory provider tools in sequential execution path - #4785

Closed
lance0 wants to merge 1 commit into
NousResearch:mainfrom
lance0:fix/sequential-memory-provider-dispatch
Closed

fix(agent): route memory provider tools in sequential execution path#4785
lance0 wants to merge 1 commit into
NousResearch:mainfrom
lance0:fix/sequential-memory-provider-dispatch

Conversation

@lance0

@lance0 lance0 commented Apr 3, 2026

Copy link
Copy Markdown

Summary

The sequential tool execution path (_execute_tool_calls_sequential) was missing two dispatches that exist in the concurrent path (_invoke_tool):

  1. Memory provider tool routing — tools like fact_store and fact_feedback (from holographic, hindsight, etc.) were registered in valid_tool_names and passed validation, but fell through to handle_function_call() which doesn't know about memory provider tools, causing "Unknown tool" errors.

  2. Memory write bridge — when the built-in memory tool writes to MEMORY.md/USER.md, the concurrent path notifies external memory providers via on_memory_write() so they can mirror the data. The sequential path was missing this bridge, so holographic/hindsight/etc. never received built-in memory writes.

Root Cause

_invoke_tool (used by concurrent execution) has both dispatches. _execute_tool_calls_sequential (used for single tool calls and interactive tools) had its own inline dispatch that was missing them. Single tool calls are the common case for gateway/Telegram, so this affected most real-world usage.

Fix

15-line addition to _execute_tool_calls_sequential:

  • elif branch routing memory provider tools through _memory_manager.handle_tool_call()
  • on_memory_write() bridge after built-in memory tool execution

Both match the existing behavior in _invoke_tool.

Testing

  • Confirmed memory provider registers and activates correctly (tools in valid_tool_names)
  • Confirmed model generates proper fact_store tool calls (raw API test to llama-server)
  • Confirmed tool validation passes (fact_store in valid_tool_names = True)
  • Confirmed on_memory_write bridge works: built-in memory writes now mirror to holographic SQLite store with HRR vectors
  • Tested with both Qwen3.5-27B and Gemma 4 31B via local llama-server

Fixes #4781

The concurrent tool execution path (`_invoke_tool`) correctly routes
memory provider tools (e.g. `fact_store`, `fact_feedback`) through
`_memory_manager.handle_tool_call()` and bridges built-in memory writes
to external providers via `on_memory_write()`. However, the sequential
execution path (`_execute_tool_calls_sequential`) was missing both:

1. Memory provider tool dispatch — tool calls fell through to
   `handle_function_call()` which doesn't know about memory provider
   tools, causing "Unknown tool" errors.

2. Memory write bridge — built-in `memory` tool writes were not
   mirrored to external providers (e.g. holographic SQLite store).

This adds both dispatches to the sequential path, matching the behavior
already present in `_invoke_tool`.

Fixes NousResearch#4781
@fire

fire commented Apr 3, 2026

Copy link
Copy Markdown

I think the pull request works for me.

@lance0

lance0 commented Apr 3, 2026

Copy link
Copy Markdown
Author

Fix merged in #4803 (v0.7.0). Closing this one — glad the diagnosis helped. 🎉

@lance0 lance0 closed this Apr 3, 2026
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.

Holographic memory plugin registers but tools not injected into agent loop

2 participants