You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Ollama embed request timeout (added in #656) is read from OLLAMA_EMBEDDING_TIMEOUT / REPOWISE_EMBEDDING_TIMEOUT and passed straight through float(...) with no validation, in both the CLI mapper and the embedder constructor:
packages/cli/src/repowise/cli/providers/embedders.py — _embedder_kwargs() does kwargs["timeout"] = float(timeout)
packages/core/src/repowise/core/providers/embedding/ollama.py — __init__ does float(env_timeout) if env_timeout else _DEFAULT_TIMEOUT
Non-positive / non-finite values are accepted and passed to httpx.0, -5, inf, nan all pass the bare float() and reach httpx.AsyncClient(timeout=...). A 0 or negative timeout makes every embed request fail immediately; inf/nan are nonsensical.
Steps to Reproduce
Configure the Ollama embedder: export OLLAMA_EMBEDDING_MODEL=embeddinggemma
Set a malformed timeout: export OLLAMA_EMBEDDING_TIMEOUT=abc (also try 0, -5, inf)
Run any flow that builds the embedder, e.g. repowise reindex, or directly:
fromrepowise.cli.providersimportbuild_embedderbuild_embedder("ollama") # with abc -> returns MockEmbedder() silently
Expected Behavior
A malformed, non-positive, or non-finite timeout is reported rather than silently swallowed, and the value is validated before use. Ideally consistent with the direction taken in #324 (surface the degradation, e.g. via _embedder_status, rather than silently mock). The exact shape is a maintainer call.
Actual Behavior
OLLAMA_EMBEDDING_TIMEOUT=abc -> build_embedder("ollama") returns MockEmbedder() with only a WARNING on the CLI path; semantic search silently disabled.
OLLAMA_EMBEDDING_TIMEOUT=0 / -5 / inf -> passed unvalidated to httpx.AsyncClient(timeout=...).
Environment
OS: macOS (this is environment-independent; a code-level validation gap)
Related: #656 (added the configurable timeout), and #306 / #324 (the silent-MockEmbedder-on-init class, fixed for the MCP path only).
Happy to open a PR once the intended shape is decided, specifically whether a bad embedder config should surface through the _embedder_status degradation envelope (matching #324), warn, or clamp, and whether the CLI build_embedder() fallback should distinguish configuration errors from genuine provider-unavailability.
Describe the Bug
The Ollama embed request timeout (added in #656) is read from
OLLAMA_EMBEDDING_TIMEOUT/REPOWISE_EMBEDDING_TIMEOUTand passed straight throughfloat(...)with no validation, in both the CLI mapper and the embedder constructor:packages/cli/src/repowise/cli/providers/embedders.py—_embedder_kwargs()doeskwargs["timeout"] = float(timeout)packages/core/src/repowise/core/providers/embedding/ollama.py—__init__doesfloat(env_timeout) if env_timeout else _DEFAULT_TIMEOUTTwo failure modes result:
A non-numeric value raises, and the CLI path swallows it into a silent MockEmbedder.
OLLAMA_EMBEDDING_TIMEOUT=abcmakesfloat("abc")raiseValueErrorinside_embedder_kwargs().build_embedder()catches it withexcept Exception: return MockEmbedder(), so semantic search silently runs on mock vectors with no error. This is the same silent-degradation class as [Bug] Configured embedder silently falls back to MockEmbedder on init failure — broken semantic search looks healthy #306, which fix(mcp): surface embedder init failure instead of silent mock fallback #324 fixed for the MCP-server path (via the_embedder_statusenvelope); but the CLIbuild_embedder()path was not covered and still swallows to mock.Non-positive / non-finite values are accepted and passed to httpx.
0,-5,inf,nanall pass the barefloat()and reachhttpx.AsyncClient(timeout=...). A0or negative timeout makes every embed request fail immediately;inf/nanare nonsensical.Steps to Reproduce
export OLLAMA_EMBEDDING_MODEL=embeddinggemmaexport OLLAMA_EMBEDDING_TIMEOUT=abc(also try0,-5,inf)repowise reindex, or directly:Expected Behavior
A malformed, non-positive, or non-finite timeout is reported rather than silently swallowed, and the value is validated before use. Ideally consistent with the direction taken in #324 (surface the degradation, e.g. via
_embedder_status, rather than silently mock). The exact shape is a maintainer call.Actual Behavior
OLLAMA_EMBEDDING_TIMEOUT=abc->build_embedder("ollama")returnsMockEmbedder()with only a WARNING on the CLI path; semantic search silently disabled.OLLAMA_EMBEDDING_TIMEOUT=0/-5/inf-> passed unvalidated tohttpx.AsyncClient(timeout=...).Environment
main(after fix(mcp): defer answer-by-union to synthesis when the mention is incidental #823, v0.31.x)Additional Context
Related: #656 (added the configurable timeout), and #306 / #324 (the silent-MockEmbedder-on-init class, fixed for the MCP path only).
Happy to open a PR once the intended shape is decided, specifically whether a bad embedder config should surface through the
_embedder_statusdegradation envelope (matching #324), warn, or clamp, and whether the CLIbuild_embedder()fallback should distinguish configuration errors from genuine provider-unavailability.