Bug Description
When crossSessionSearch is set to true in the Honcho plugin configuration, the memory_search tool should search across all sessions. However, it still limits results to the current session and its child sessions.
Expected Behavior
With crossSessionSearch=true, memory_search should return results from all sessions in the workspace, not just the active session scope.
Actual Behavior
Even when crossSessionSearch is explicitly set to true, search results are limited to the current session. This happens because the search logic passes the sessionKey parameter to scoped search whenever requestedSessionKey is present, bypassing the cross-session ownerPeer.search() call.
Root Cause
In dist/runtime.js, the search function handles requestedSessionKey by performing a scoped search:
if (requestedSessionKey) {
const exactSession = await state.honcho.session(requestedSessionKey, {...});
collect(await exactSession.search(query, { limit }));
// ... scoped session search
}
else {
collect(await ownerPeer.search(query, { limit }));
}
When crossSessionSearch=true and requestedSessionKey is present, the code never falls back to ownerPeer.search() for cross-session results.
Proposed Fix
Add a fallback to ownerPeer.search() when crossSessionSearch is enabled and scoped search results are insufficient:
// After scoped search, add fallback:
if (state.cfg.crossSessionSearch && filtered.length < limit) {
collect(await ownerPeer.search(query, { limit: limit - filtered.length }));
}
Bug Description
When
crossSessionSearchis set totruein the Honcho plugin configuration, thememory_searchtool should search across all sessions. However, it still limits results to the current session and its child sessions.Expected Behavior
With
crossSessionSearch=true,memory_searchshould return results from all sessions in the workspace, not just the active session scope.Actual Behavior
Even when
crossSessionSearchis explicitly set totrue, search results are limited to the current session. This happens because the search logic passes thesessionKeyparameter to scoped search wheneverrequestedSessionKeyis present, bypassing the cross-sessionownerPeer.search()call.Root Cause
In
dist/runtime.js, thesearchfunction handlesrequestedSessionKeyby performing a scoped search:When
crossSessionSearch=trueandrequestedSessionKeyis present, the code never falls back toownerPeer.search()for cross-session results.Proposed Fix
Add a fallback to
ownerPeer.search()whencrossSessionSearchis enabled and scoped search results are insufficient: