fix: honor defaultHeaders null for helper method header#1857
Open
Genmin wants to merge 1 commit intoopenai:masterfrom
Open
fix: honor defaultHeaders null for helper method header#1857Genmin wants to merge 1 commit intoopenai:masterfrom
Genmin wants to merge 1 commit intoopenai:masterfrom
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.
Fixes #1499.
Helper-method headers were previously injected as ordinary per-request headers by helpers such as
runTools(),stream(), andchat.completions.parse(). Since per-request headers are merged afterdefaultHeaders, users could not suppressX-Stainless-Helper-MethodwithdefaultHeaders: { 'x-stainless-helper-method': null }even though that works for the other Stainless telemetry headers.This moves helper-method markers into internal request metadata and emits the header from the client’s internal header block, before
defaultHeadersare applied. Existing helper telemetry remains present by default, while explicit default-header nulls can now remove it consistently.Validation:
yarn fix src/client.ts src/lib/ChatCompletionRunner.ts src/lib/ChatCompletionStreamingRunner.ts src/lib/ChatCompletionStream.ts src/lib/responses/ResponseStream.ts src/lib/AssistantStream.ts src/resources/chat/completions/completions.ts tests/lib/ChatCompletionRunFunctions.test.tsyarn test tests/lib/ChatCompletionRunFunctions.test.ts