Repository navigation
test(kb): prove in-loop RAG context injection end-to-end - #599
Conversation
Add a hermetic integration test that enables the kb plugin via a temp config override (not the shipped default), injects a deterministic fake embedder, indexes a sentinel fact, and runs one real PipelineAdapter turn with a mocked LLM provider — asserting the retrieved chunk lands in the context the provider receives. No production code changes; no network. Closes step 1 of the personal-agent RAG roadmap (validate in-loop RAG). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new async integration test file is added that verifies the KB plugin injects RAG context into the agent loop. It configures an agent with the ChangesKB In-Loop RAG Context Injection Integration Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Step ① of the personal-agent RAG roadmap: prove that enabling the
kbplugin actually makes RAG run in the agent loop (it never has —kbis wired incore/app.pybut absent from the default[agent.plugins].enabled, so retrieval was only ever validated standalone via CLI/evals).Key fact:
KBPluginis a context-injection plugin (build_context), not a model-callable tool — once enabled it auto-retrieves and injects matched KB chunks into the context on every user message.What this adds
tests/integration/test_kb_in_loop.py— one hermetic test that:kbvia a temp config override (does NOT touch shippedagent.toml/ helm configmap),embedding_fn(KBPlugin supports it) and monkeypatches the KB OpenAI clients to hard-fail if a real endpoint is hit,PipelineAdapterturn with a mocked LLM provider,[Context Pack]/## Repo references).Verification
uv run pytest tests/integration/test_kb_in_loop.py tests/coding_agent/plugins/test_kb_plugin.py -q→ 14 passed (run outside codex sandbox).Scope / not in this PR
kb.enabledknob +[kb]render + SiliconFlow embedding secret + indexing Job for SRE/Obsidian corpora.🤖 Generated with Claude Code
Summary by CodeRabbit