fix: note-tool timeout (background RAG indexing) + feature-flag raw-key display (#252)

- note timeout: JournalService.add_entry awaited RAG indexing inline (despite its
  "non-blocking" comment); indexing embeds via Ollama, which is CPU-bound, so
  under concurrent load it slowed enough to time the `note` gateway tool out.
  The entry is already committed before indexing, so it's best-effort — schedule
  it fire-and-forget (_schedule_rag_index) so the write returns immediately.
  A new drain_rag_index_tasks() helper lets tests await the pending index.

- feature flags: the "Gateway-health recovery" toggle rendered its raw key
  `gateway_health_enabled` (the only flag with no human description). Added the
  blurb and changed the fallback to render nothing rather than leak a raw key.

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
Renzo F
2026-06-24 04:39:40 +02:00
committed by GitHub
co-authored by Renn F
parent 7094c3c171
commit acaf3486e8
4 changed files with 90 additions and 40 deletions
+2 -1
View File
@@ -35,7 +35,7 @@ from roboco.models.journal import (
StruggleEntryParams,
TaskReflectionParams,
)
from roboco.services.journal import JournalService
from roboco.services.journal import JournalService, drain_rag_index_tasks
from sqlalchemy import select, update
from sqlalchemy.exc import IntegrityError as _IE
@@ -505,6 +505,7 @@ async def test_create_entry_learning_calls_record_learning(
)
)
assert entry is not None
await drain_rag_index_tasks() # indexing is fire-and-forget; let it run
mock_optimal.record_learning.assert_awaited()