|
agent: cwd-aware memory fact filter for bounded autonomy
Long-term memory stored context-dependent path facts (e.g. "project_root → /home/.../navi-1") as global user facts. search_facts injected them into any session, so when working in another project the agent was told "the project root is navi-1" and drifted there. When scope_boundary_enabled and a session cwd is set, _memory_facts_msg now drops facts whose value is an absolute path outside the session cwd tree. Facts are kept when working inside that path (then they are correct), and non-path/relative facts always pass. Free flight stays reproducible by toggling the flag off. No facts deleted, extractor untouched. Co-Authored-By: Claude <noreply@anthropic.com> |
|---|
|
|
| navi/core/agent.py |
|---|
| navi/core/context_builder.py |
|---|
| tests/unit/core/test_context_builder.py |
|---|