Fix post-merge correctness and hardening gaps - #5
Merged
Conversation
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.
Motivation
Description
Content-Length, enforcingRAG_MAX_REQUEST_BYTESbefore JSON parsing viaBodySizeLimitMiddleware, and streaming/cancelling oversized request bodies inservice/rag_service/app.py.app/app/lib/limits.ts, streaming JSON parsing with a byte budget, and addingRAG_SERVICE_TIMEOUT_MS-driven upstream timeouts inapp/app/lib/rag.tsthat map timeouts to504._finite_env_floatand ensure_positive_env_floatrejects non-finite values inservice/rag_service/generation.pyandservice/rag_service/app.pyto avoid silent misconfiguration.insert_batchreturned ids, and holding the store lock acrosssearch+ metadata lookup to prevent concurrent mutation races inservice/rag_service/store.py.service/tests/test_e2e.pyand a newservice/tests/test_generation_timeout.py; document the newRAG_SERVICE_TIMEOUT_MSsetting inREADME.mdand update the Next.js client types to surfacelimitsanduploads_enabled.Testing
cargo test --workspace— all Rust tests passed.PYTHONPATH=service pytest -q bindings/tests service/tests—59 passed, 1 warning.cd app && npm run buildandnpx tsc --noEmit— build and type-check succeeded.ruffpassed for modified Python code andcargo fmt/rustchecks passed.fix/post-merge-correctnesswith commit2a967be38ed57a24e2844ed6ccc9750b8edfd741containing the changes above.