Repository navigation
fix(embeddings): forward timeout/batch_size/max_retries from config to the OpenAI provider - #361
Conversation
…o the OpenAI provider The OpenAI factory path dropped these three settings while the VoyageAI path forwarded them, so OpenAI-compatible providers always ran with the hardcoded 30s timeout / batch_size 100 / 3 retries regardless of configuration. Adds a regression test that fails against the previous factory behavior. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Summary: Clean, minimal fix for a genuine config-forwarding bug — the OpenAI factory path now matches the VoyageAI path it was asymmetric with. Strengths:
Issues: Minor — Minor — Observation — test style: The test accesses private attributes ( Reusability: No refactoring needed; the change is already as DRY as possible given the two factory methods. Decision: APPROVE The core fix is correct and the test is sound. The two minor issues (undocumented docstring params, missing debug log entries) can be addressed in a follow-up or as a quick amendment — they don't affect correctness. |
|
@GoodOlClint The PR looks great. |
…ebug logs Address review feedback on chunkhound#361: - Document batch_size/timeout/retry_attempts in create_openai_provider Args block - Include timeout/batch_size/max_retries in the OpenAI factory debug logs Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@HananKavitzAmat Thanks! Both minor issues addressed in 58bc92e:
The test observation is noted; left the private-attr access as-is since there's no public accessor for timeout. |
|
@GoodOlClint Looks good bu you have some unresolved conflict |
…rops-embedding-config # Conflicts: # chunkhound/core/config/embedding_factory.py
|
Merged latest |
|
@GoodOlClint Thanks. Merged |
Resolved 4 conflict sites and 5 auto-merge gaps between db-portability (code hygiene, DB portability, lint fixes across 400+ files) and main (#361 config forwarding, #356 cosine similarity scoring). Conflict 1: discovery.py - _read_startup_timeout -> _resolve_startup_timeout Conflict 2: search_service.py - query param in search_regex_async Conflict 3: unified_search.py - skip_rerank, exclude_ids params Conflict 4: elbow_filter.py - get_unified_score similarity field handling Auto-merge gaps fixed: - query kwarg signature in SerialDatabaseProvider.search_regex_async - score_fn support in chunk_dedup.py - Depth exploration base_cosine search class integration - gap_detection.py scoring path unification - duckdb_provider.py type annotation boundary fix Fixes included: - query: str | None = None param added to SerialDatabaseProvider.search_regex_async - Test assertions updated: _read_startup_timeout -> _resolve_startup_timeout
Fixes #360.
What
The OpenAI factory path (
EmbeddingProviderFactory._create_openai_provider) droppedtimeout,batch_size, andmax_retriesfrom the provider config, so OpenAI-compatible providers always ran with the hardcoded 30s / 100 / 3 defaults regardless of configuration. The VoyageAI path in the same factory already forwards all three; this makes the OpenAI path symmetric.create_openai_provider()growsbatch_size/timeout/retry_attemptskeyword args (defaults unchanged) and forwards them toOpenAIEmbeddingProvider, which already accepted them.config.get("timeout", 30),config.get("batch_size", 100),config.get("max_retries", 3)— same keys and defaults the VoyageAI path uses.Why it matters
Local OpenAI-compatible endpoints (Ollama, LM Studio, llama.cpp, MLX servers) routinely exceed 30s per embedding batch with larger models; the configured timeout was silently ignored (see the last comment on #134 — a user hitting exactly this after that issue closed).
Test
tests/test_embedding_factory_forwards_config.py— verified discriminating: fails against the previous factory behavior (_timeoutstuck at 30 withtimeout: 120configured), passes with the fix; also pins that defaults are preserved when the keys are absent.🤖 Generated with Claude Code