Repository navigation
fix(overrides): forward arguments through patched get_headers - #823
Merged
jasonozuzu-cohere merged 1 commit intoOct 27, 2026
Merged
jasonozuzu-cohere merged 1 commit into
jasonozuzu-cohere merged 1 commit into
Conversation
Generator 5.34.2+ calls get_headers(include_token=...) from async_get_headers. The empty-api-key override only accepted self, so every async request would raise TypeError after regenerating. Forward *args/**kwargs on both the sync and async patches so the override works with the current and newer generated client wrapper. Co-authored-by: Cursor <cursoragent@cursor.com>
mkozakov
approved these changes
Oct 27, 2026
jasonozuzu-cohere
deleted the
jasonozuzu/pts-9492-fix-header-override-bug-in-cohere-python
branch
October 27, 2026 15:54
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.
Generator 5.34.2+ calls get_headers(include_token=...) from async_get_headers. The empty-api-key override only accepted self, so every async request would raise TypeError after regenerating. Forward *args/**kwargs on both the sync and async patches so the override works with the current and newer generated client wrapper.
Note
Low Risk
Small compatibility fix in a header monkey-patch; no change to auth semantics beyond fixing argument forwarding for newer generated clients.
Overview
Updates the empty API key override in
omit_authorization_header_when_api_key_is_empty()so the monkey-patchedget_headersandasync_get_headersaccept and pass through*argsand**kwargsto the original implementations.Previously the patches only took
self, which breaks after regenerating with Fern 5.34.2+, whereasync_get_headersforwards calls likeget_headers(include_token=...)and would raise TypeError on every async request. Behavior for stripping a bareBearerauthorization header is unchanged.Reviewed by Cursor Bugbot for commit d8d8f6c. Bugbot is set up for automated code reviews on this repo. Configure here.