Skip to content

refactor(daemon): use shared config for embedding enablement (#828) - #891

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/embedding-config-828
May 7, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/embedding-config-828

Conversation

@Sinity

@Sinity Sinity commented May 7, 2026

Copy link
Copy Markdown
Owner

Config-driven embedding. 1 file +13/-12.

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]>
Copilot AI review requested due to automatic review settings May 7, 2026 08:42
@Sinity
Sinity merged commit 351620a into master May 7, 2026
@Sinity
Sinity deleted the feature/feat/embedding-config-828 branch May 7, 2026 08:42
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 28 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f89fdeb3-8f49-4e33-9f82-de24d661eeca

📥 Commits

Reviewing files that changed from the base of the PR and between c2069d3 and 0732d56.

📒 Files selected for processing (1)
  • polylogue/daemon/convergence_stages.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/embedding-config-828

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread polylogue/daemon/convergence_stages.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() from os.environ to load_polylogue_config().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +471 to +476
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"))
Comment on lines +475 to +476
cfg = load_polylogue_config()
return bool(cfg.get("embedding_enabled")) and bool(cfg.get("voyage_api_key"))
Comment on lines +510 to 515
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:
Sinity added a commit that referenced this pull request May 7, 2026
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
Sinity added a commit that referenced this pull request May 7, 2026
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
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 62.F048 / P1: fixed-already at the checked revision: Environment loading now validates boolean keys explicitly at polylogue/config.py:1893-1899. The reported POLYLOGUE_DAEMON_ENABLE_EMBEDDINGS=maybe input is rejected as invalid boolean configuration rather than surviving as a truthy string that starts provider work.

Only the rows listed above are dispositioned. Held findings remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants