docs: clarify header defaults for custom session/client injection#165
Open
shaun0927 wants to merge 1 commit into
Open
docs: clarify header defaults for custom session/client injection#165shaun0927 wants to merge 1 commit into
shaun0927 wants to merge 1 commit into
Conversation
The custom session/client injection feature intentionally preserves existing headers while filling in Tavily defaults when callers also provide an api_key. The README described precedence and lifecycle but not the default-header injection behavior, which can surprise users who reuse shared HTTP clients. Constraint: Keep scope to README-only clarification for mergeability Rejected: Change runtime behavior to avoid mutating external clients | behavior is already documented in tests and intended by design Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep docs aligned with the tested contract for custom session/client injection Tested: `pytest -q tests/test_custom_session.py tests/test_session_pooling.py` Not-tested: Runtime behavior beyond existing covered tests
Author
|
This PR is ready for review. Why I kept the scope narrow:
Validation:
The goal here is only to make the existing contract more explicit for integrators using shared HTTP clients. |
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.
Summary
api_keyis also providedWhy
The current implementation and tests already support this behavior, but the README only says that custom headers take precedence and that external sessions are user-managed. This small clarification makes the current contract more explicit for integrators using shared HTTP clients.
Testing
pytest -q tests/test_custom_session.py tests/test_session_pooling.pyCloses #164