Skip to content

fix(overrides): forward arguments through patched get_headers - #823

Merged
jasonozuzu-cohere merged 1 commit into
mainfrom
jasonozuzu/pts-9492-fix-header-override-bug-in-cohere-python
Oct 27, 2026
Merged

jasonozuzu-cohere merged 1 commit into
mainfrom
jasonozuzu/pts-9492-fix-header-override-bug-in-cohere-python

Conversation

@jasonozuzu-cohere

@jasonozuzu-cohere jasonozuzu-cohere commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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-patched get_headers and async_get_headers accept and pass through *args and **kwargs to the original implementations.

Previously the patches only took self, which breaks after regenerating with Fern 5.34.2+, where async_get_headers forwards calls like get_headers(include_token=...) and would raise TypeError on every async request. Behavior for stripping a bare Bearer authorization header is unchanged.

Reviewed by Cursor Bugbot for commit d8d8f6c. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
@jasonozuzu-cohere
jasonozuzu-cohere merged commit f2decac into main Oct 27, 2026
4 checks passed
@jasonozuzu-cohere
jasonozuzu-cohere deleted the jasonozuzu/pts-9492-fix-header-override-bug-in-cohere-python branch October 27, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants