# Obsidian-RAG Issue Report: Agent Tool vs. Manual CLI Discrepancy

## Issue Description
The `obsidian_rag_search` tool, when called by the agent, returns zero results (`results: []`) and reports the plugin health as `unavailable`, even though the user can successfully retrieve results using the same query via the manual CLI: `obsidian-rag search "journey to northeast US with mom"`.

## Analysis
1. **Tool Behavior:** 
   - `obsidian_rag_status` returns `status: "unavailable"`, `total_docs: 0`, and `total_chunks: 0`.
   - `obsidian_rag_search` returns `status: "degraded"` and an empty results list.
   - Triggering `obsidian_rag_index(mode="sync")` reports a job started, but subsequent status checks still show `unavailable`.

2. **Manual CLI Behavior:**
   - The user reports that the same query works perfectly when run directly in the shell.

3. **Log Review:**
   - `audit.log` shows that the indexing process is actually working. It has successfully indexed hundreds of files (e.g., `/home/san/KnowledgeVault/Default/Journal/...` and `/home/san/KnowledgeVault/Default/Logseq/journals/...`) with timestamps matching the current session window.
   - The logs confirm that chunks are being created and assigned IDs (e.g., `chunk_id: "06927c8364e7"`), meaning the backend database is populated.

## Conclusion
The issue is not with the indexing or the data—the `audit.log` proves the vault is indexed. The issue lies in the **communication layer between the agent's tool implementation and the plugin backend**. While the CLI tool is correctly accessing the index, the agent's tool calls are failing to connect to or authenticate with the same service, leading to the "unavailable" status and empty results.

## Evidence
- **Log Entry (Indexing Success):**
  `{"timestamp": "2026-04-12T03:44:52.226573+00:00", "file_path": "/home/san/KnowledgeVault/Default/PRompt.md", "action": "index", ...}`
- **Tool Output (Failure):**
  `{"status":"unavailable","data":{"plugin_health":"unavailable","total_docs":0,"total_chunks":0...}}`
