feat: configurable EMBED_TIMEOUT_MS / RERANK_TIMEOUT_MS - #29
Merged
Conversation
Add EMBED_TIMEOUT_MS and RERANK_TIMEOUT_MS so operators can raise the fixed 10s HTTP timeout per deployment. Ollama embed calls have been observed taking 6-9s in production, leaving little margin against the hardcoded default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Embed/rerank client timeouts are hardcoded at 10s in embed-client.ts / rerank-client.ts. In production, ollama embed calls have been observed taking 6-9 seconds -- capture requests are racing the fixed timeout with little margin. Operators need to raise this per deployment.
What
Both use the existing optionalIntEnv helper in mount-config.ts (positive-int validation, undefined when unset so each client's own 10s default still applies).
Added EngineConfig.embed.timeoutMs / EngineConfig.rerank.timeoutMs fields (were missing -- the intermediate config type would have dropped the value between loadMemoryConfig() and the client config it feeds).
Tests
New src/mount-config.test.ts covering: unset -> undefined (default preserved), and each env var set -> flows through to the resulting config field. Full suite passes (318 tests).