Repository navigation
fix: restore clientHeaders passthrough in chatCore (regression from #1227) #1335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1563,6 +1563,7 @@ export async function handleChatCore({ | |||||
| log, | ||||||
| extendedContext, | ||||||
| upstreamExtraHeaders: buildUpstreamHeadersForExecute(modelToCall), | ||||||
| clientHeaders: clientRawRequest?.headers ?? null, | ||||||
| }); | ||||||
|
|
||||||
| // Qwen 429 strict quota backoff (wait 1.5s, 3s and retry) | ||||||
|
|
@@ -1763,6 +1764,7 @@ export async function handleChatCore({ | |||||
| log, | ||||||
| extendedContext, | ||||||
| upstreamExtraHeaders: buildUpstreamHeadersForExecute(retryModelId), | ||||||
| clientHeaders: clientRawRequest?.headers ?? null, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a potential type mismatch here. The To ensure type safety and correct behavior, it's better to explicitly convert a
Suggested change
|
||||||
| }); | ||||||
|
|
||||||
| if (retryResult.response.ok) { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential type mismatch here. The
ExecuteInput.clientHeadersproperty is typed asRecord<string, string> | null, butclientRawRequest.headerscan be aHeadersobject, which is not directly assignable. This could lead to issues in the executor if it expects a plain object.To ensure type safety and correct behavior, it's better to explicitly convert a
Headersobject to a plain object before passing it.