feat(context): add Recent-Only and RAG modes - #36
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8b6a5bd93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const databasePath = ragSettings.databasePath | ||
| ? resolvePath(ragSettings.databasePath) | ||
| : join(agentDir, "rag", `${sessionManager.getSessionId()}.sqlite`); |
There was a problem hiding this comment.
Namespace overridden RAG databases by session
When BCG_RAG_DB_PATH or contextManagement.rag.databasePath is configured, every session opens the same exact database rather than the session-specific path used by the default. The new memory schema has no session identifier and retrieval has no session predicate, so matching turns from one session can be injected into another session's system prompt, leaking unrelated context and corrupting responses. Append the session ID to configured storage or store and filter by a session key.
Useful? React with 👍 / 👎.
Summary
Tests
uv run pytest tests/test_agent_runtime.py tests/test_benchmark_adapters.py tests/test_setup.py -q— 58 passednpm test -- test/bcg-context.test.ts test/recent-context.test.ts— 27 passednpm run check— passed