From 032eef311f0122f283931e5d95407aabd88d5a67 Mon Sep 17 00:00:00 2001 From: Logan Date: Mon, 1 Jun 2026 01:26:54 -0400 Subject: [PATCH] Fix vocabulary induction loop running too late The loop slept 24h before its first pass, so suggestions would never appear unless the server was up for a full day. Move the sleep to the end so the first induction pass runs ~30s after startup. --- drb-c2-core/app/internal/vocabulary_learner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drb-c2-core/app/internal/vocabulary_learner.py b/drb-c2-core/app/internal/vocabulary_learner.py index be120cb..d90df7b 100644 --- a/drb-c2-core/app/internal/vocabulary_learner.py +++ b/drb-c2-core/app/internal/vocabulary_learner.py @@ -250,8 +250,8 @@ async def vocabulary_induction_loop() -> None: f"interval: {settings.vocabulary_induction_interval_hours}h, " f"sample budget: {settings.vocabulary_induction_sample_tokens} tokens" ) + await asyncio.sleep(30) # short startup grace period before first pass while True: - await asyncio.sleep(interval) try: flags = await get_flags() if flags["vocabulary_learning_enabled"]: @@ -260,6 +260,7 @@ async def vocabulary_induction_loop() -> None: logger.info("Vocabulary learning disabled — skipping induction pass") except Exception as e: logger.error(f"Vocabulary induction pass failed: {e}") + await asyncio.sleep(interval) async def _run_induction_pass() -> None: