Skip to content

fix(config): remove VOYAGE_API_KEY support, require CHUNKHOUND_EMBEDDING__API_KEY (#454) - #455

Open
iamcipherdev wants to merge 1 commit into
chunkhound:mainfrom
iamcipherdev:fix/remove-voyage-api-key-2026-10-25
Open

iamcipherdev wants to merge 1 commit into
chunkhound:mainfrom
iamcipherdev:fix/remove-voyage-api-key-2026-10-25

Conversation

@iamcipherdev

Copy link
Copy Markdown

Closes #454

VOYAGE_API_KEY is no longer read anywhere: both the env-layer fallback and the merged-layer fallback from #453 are removed. When voyageai is selected and no layer supplies an embedding API key while VOYAGE_API_KEY is set, configuration now fails with an error naming the replacement (CHUNKHOUND_EMBEDDING__API_KEY or embedding.api_key in .chunkhound.json). Setups that already use the CHUNKHOUND_ variable or a config-file key are unaffected, and non-voyageai providers ignore VOYAGE_API_KEY entirely.

Verification: smoke tests 14/14 pass; all 7 voyage contract tests pass (incl. new env/global/CLI-source cases); config integration + validate files 46/47, the one failure being a pre-existing sandbox DuckDB/proxy error (INSTALL vss) that fails identically on clean upstream. Full suite: 4637 passed; the 450 failures + 273 errors are pre-existing environmental failures (DuckDB proxy, httpx proxy, network-dependent provider tests) — the closest files (anthropic provider, embedding config provider check, duckdb compaction) reproduce the exact same counts on the clean tree.

…ING__API_KEY (chunkhound#454)

VOYAGE_API_KEY is no longer read: both the env-layer fallback and the
merged-layer fallback from chunkhound#453 are removed. When voyageai is selected
and no layer supplies an embedding API key while VOYAGE_API_KEY is set,
configuration now fails with an error saying what to rename. The
missing-config message, provider docstring, docs table, and changelog
name only CHUNKHOUND_EMBEDDING__API_KEY. Contract tests cover the
migration error for env, local, global, and CLI provider sources, plus
the no-error cases for configured keys and non-voyageai providers.
@HananKavitzAmat

Copy link
Copy Markdown
Collaborator

Summary: The change is small and correctly scoped, but the new migration error also fires for VoyageAI setups with a base_url, where the API key is optional, so it breaks setups that work today.

Strengths:

  • It removes both VOYAGE_API_KEY read paths from fix(config): apply VOYAGE_API_KEY after merging config layers #453: the env layer (embedding_config.py) and the merged-layer fallback (config.py). Grep of the repo finds no other runtime readers.
  • Failing loudly with the replacement named is a better migration path than silently dropping the key. The changelog lists it under Breaking Changes.
  • The tests cover the user-visible contract for each provider source (env, local, global, CLI), the configured-key case, and the non-voyageai case. I did not run them (see the note under Decision).

Issues:

  • Major — chunkhound/core/config/config.py:~346-359 (_check_removed_voyage_api_key): the check ignores base_url. get_missing_config() in embedding_config.py:~477 treats the VoyageAI key as optional when base_url is set (custom or self-hosted endpoint). A user with provider=voyageai, a base_url and no key who also has VOYAGE_API_KEY in their shell now gets a ValueError. Before this PR they got a working config. The check should also return early when embedding.get("base_url") is set. It needs a test for that case, in the same style as test_voyage_api_key_not_used_for_openai_provider.
  • Major — the check runs in Config.init for every command: the ValueError is raised from the generic config constructor, so any command that builds a Config hits it, including ones that never use embeddings. Please confirm the error reaches the user as a clean messthat validate_for_command stays the placewhere embedding requirements are enforced. I did not trace this. - Minor — embedding_config.py:~477-479: the now fits on one line, so uv run ruff formatchunkhound will reformat it. The PR does not say whether format and lint were run. - Minor — tests/test_config_integration.py: key_does_not_override_configured_key is nowredundant with the new ...ignored_when_key_configured. The new test names also drift from the test_voyage_api_key_rejected* family.
  • Minor — voyageai_provider.py:272: the docstring says api_key "defaults to CHUNKHOUND_EMBEDDING__API_KEY", but the provider takes it as an argument and the cvar. Say "supplied by config(CHUNKHOUND_EMBEDDING__API_KEY)" instead. - Minor — site/src/components/configurator-dlaceholder string, so it is fine. A quickcheck that the docs elsewhere don't recommend VOYAGE_API_KEY would be good.
    Reusability: No duplication introduced. The check reuses the existing post-merge hook point. The three test functions that differ only in the layer selecting voyad test.
    Decision: REQUEST CHANGES. Fix the base_url it, then run ruff format. I read the diffand the surrounding config code but did not run the tests, and the contributor's reported results are unverified. The fix to the key check is a one-line early ret

This branch has not been deployed

No deployments
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.

Remove VOYAGE_API_KEY support; require CHUNKHOUND_EMBEDDING__API_KEY (breaking)

2 participants