Bug Description
memory_list and memory_recall tools return no results when called without an explicit scope parameter, even though memories exist in agent-specific scopes.
Steps to Reproduce
- Store memories with scope
agent:tg-dm-xxx (agent-specific scope)
- Call
memory_list without any scope parameter
- Result: "No memories found" even though entries exist
Root Cause
In src/scopes.ts, the getAllScopes() method only returns explicitly defined scopes from this.config.definitions:
getAllScopes(): string[] {
return Object.keys(this.config.definitions);
}
When memory_list is called without a scope parameter, it falls back to:
let scopeFilter = context.scopeManager.getAccessibleScopes(agentId);
For an agent with no explicit agentAccess entry and agentId = undefined, getAccessibleScopes(undefined) calls getAllScopes() which only returns [global], missing all agent:xxx scopes.
The issue is that built-in dynamic scope patterns like agent:${agentId} are not included in getAllScopes() even though getAccessibleScopes(agentId) would return them correctly for a known agentId.
Expected Behavior
Calling memory_list or memory_recall without a scope parameter should return memories from all accessible scopes including agent-specific scopes.
Suggested Fix
One approach: modify getAllScopes() to also include the agent pattern scopes:
getAllScopes(): string[] {
const defined = Object.keys(this.config.definitions);
const agentScopes = Object.keys(this.config.agentAccess).map(id => `agent:${id}`);
return [...new Set([...defined, ...agentScopes])];
}
Or alternatively, fix the fallback logic in memory_list to handle the case where no agentId is resolved.
Bug Description
memory_listandmemory_recalltools return no results when called without an explicitscopeparameter, even though memories exist in agent-specific scopes.Steps to Reproduce
agent:tg-dm-xxx(agent-specific scope)memory_listwithout any scope parameterRoot Cause
In
src/scopes.ts, thegetAllScopes()method only returns explicitly defined scopes fromthis.config.definitions:When
memory_listis called without a scope parameter, it falls back to:For an agent with no explicit
agentAccessentry andagentId = undefined,getAccessibleScopes(undefined)callsgetAllScopes()which only returns[global], missing allagent:xxxscopes.The issue is that built-in dynamic scope patterns like
agent:${agentId}are not included ingetAllScopes()even thoughgetAccessibleScopes(agentId)would return them correctly for a known agentId.Expected Behavior
Calling
memory_listormemory_recallwithout a scope parameter should return memories from all accessible scopes including agent-specific scopes.Suggested Fix
One approach: modify
getAllScopes()to also include the agent pattern scopes:Or alternatively, fix the fallback logic in
memory_listto handle the case where no agentId is resolved.