Repository navigation
refactor(daemon): use shared config for embedding enablement (#828) - #891
Conversation
Replace _embedding_env_enabled() env var reads with _embedding_config_enabled() that consumes the shared config layer from #829. Removes two scattered os.environ.get() call sites. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0732d56105
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Refactors the daemon’s convergence pipeline to gate the embedding stage using the shared polylogue.config.load_polylogue_config() layer (instead of direct environment-variable checks), aiming to make embedding enablement config-driven and consistent across surfaces.
Changes:
- Replaces
_embedding_env_enabled()with_embedding_config_enabled()and updates all embed-stage gating to use the shared config loader. - Switches Voyage API key lookup in
_embed_conversations_sync()fromos.environtoload_polylogue_config().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _embedding_config_enabled() -> bool: | ||
| """Check whether embedding convergence is enabled via the shared config layer.""" | ||
| from polylogue.config import load_polylogue_config | ||
|
|
||
| enabled = os.environ.get("POLYLOGUE_DAEMON_ENABLE_EMBEDDINGS", "").lower() in {"1", "true", "yes"} | ||
| return enabled and bool(os.environ.get("VOYAGE_API_KEY")) | ||
| cfg = load_polylogue_config() | ||
| return bool(cfg.get("embedding_enabled")) and bool(cfg.get("voyage_api_key")) |
| cfg = load_polylogue_config() | ||
| return bool(cfg.get("embedding_enabled")) and bool(cfg.get("voyage_api_key")) |
| voyage_key = load_polylogue_config().get("voyage_api_key") | ||
| if not voyage_key: | ||
| return True | ||
|
|
||
| vec_provider = create_vector_provider(voyage_api_key=voyage_key, db_path=db_path) | ||
| vec_provider = create_vector_provider(voyage_api_key=str(voyage_key), db_path=db_path) | ||
| if vec_provider is None: |
Single-file follow-up to PR #863. The embedding convergence stage was checking `os.environ` directly for the opt-in flag, duplicating the lookup the rest of the daemon already gets from `PolylogueConfig`. Routes the check through the typed config in `polylogue/daemon/convergence_stages.py` so changes to the embedding flag (TOML, env, or programmatic) take effect uniformly. Refs #828
Single-file follow-up to PR #863. The embedding convergence stage was checking `os.environ` directly for the opt-in flag, duplicating the lookup the rest of the daemon already gets from `PolylogueConfig`. Routes the check through the typed config in `polylogue/daemon/convergence_stages.py` so changes to the embedding flag (TOML, env, or programmatic) take effect uniformly. Refs #828
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Config-driven embedding. 1 file +13/-12.