-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Problem
build_context can return empty results for notes that are retrievable via read-note, especially when callers pass path-like identifiers that are valid from user perspective but not exact permalink matches.
Related downstream issue: basicmachines-co/openclaw-basic-memory#17
Why this looks upstream
ContextService.build_context performs exact permalink lookup for non-wildcard URLs and currently has no fallback resolution path:
src/basic_memory/services/context_service.pysrc/basic_memory/mcp/tools/build_context.pysrc/basic_memory/mcp/project_context.py(resolve_project_and_path)
Requested fix
Improve context identifier resolution and empty-result diagnostics:
- If exact permalink lookup returns 0 primaries, try a fallback resolver path:
- alternate project-prefix normalization (with/without project prefix), and/or
- resolve via entity resolver (same strategy family used by read tooling).
- Include normalized/resolved lookup path in JSON metadata when results are empty.
- Return a machine-readable "no primary match" reason (not just empty list) so clients can distinguish "no relations" from "lookup miss".
Acceptance criteria
build_contextfinds primary note for common memory URL forms when note exists.- Empty result payload includes enough diagnostics to debug path mismatch quickly.
- Backward compatibility: existing successful exact lookups behave unchanged.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request