fix: startup checks for autobot#69
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the startup configuration validation to ensure that a missing ChromaDB index does not prevent the server from booting, as it is now handled by a background warmup task. The review feedback correctly identifies that the log messages should be updated to reflect that this process occurs in the background at startup, rather than waiting for the first request.
| logger.warning( | ||
| f"CHROMA_PERSIST_DIR={chroma_dir} exists but contains no chroma.sqlite3 — " | ||
| f"warmup task will build the index on first request" | ||
| ) |
There was a problem hiding this comment.
The log message states that the index will be built 'on first request', but according to the lifespan implementation in server.py and the comments added in this PR (lines 67-68), the warmup task is triggered eagerly at startup in the background. This discrepancy can be confusing for operators monitoring the server's initialization.
| logger.warning( | |
| f"CHROMA_PERSIST_DIR={chroma_dir} exists but contains no chroma.sqlite3 — " | |
| f"warmup task will build the index on first request" | |
| ) | |
| logger.warning( | |
| f"CHROMA_PERSIST_DIR={chroma_dir} exists but contains no chroma.sqlite3 — " | |
| "warmup task will build the index in the background" | |
| ) |
| logger.warning( | ||
| f"CHROMA_PERSIST_DIR={chroma_dir} does not exist — " | ||
| f"warmup task will create and populate it on first request" | ||
| ) |
There was a problem hiding this comment.
Similar to the previous warning, the index creation and population happen in the background at startup via the warmup task, not 'on first request'. Updating this message ensures consistency with the actual server behavior.
| logger.warning( | |
| f"CHROMA_PERSIST_DIR={chroma_dir} does not exist — " | |
| f"warmup task will create and populate it on first request" | |
| ) | |
| logger.warning( | |
| f"CHROMA_PERSIST_DIR={chroma_dir} does not exist — " | |
| "warmup task will create and populate it in the background" | |
| ) |
No description provided.