fix(cerebras,mistral): strip unsupported client_metadata from downstream requests
Cerebras returns 400 (wrong_api_format) and Mistral returns 422 (extra_forbidden) when the forwarded body contains client_metadata. Remove it for these two providers before sending downstream. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0c7c9de00a
commit
d652300e9e
1 changed files with 7 additions and 0 deletions
|
|
@ -13,6 +13,13 @@ export class DefaultExecutor extends BaseExecutor {
|
|||
|
||||
transformRequest(model, body) {
|
||||
const transformed = this.applyJsonSchemaFallback(body);
|
||||
|
||||
if (transformed && typeof transformed === "object") {
|
||||
if (this.provider === "cerebras" || this.provider === "mistral") {
|
||||
delete transformed.client_metadata;
|
||||
}
|
||||
}
|
||||
|
||||
return injectReasoningContent({ provider: this.provider, model, body: transformed });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue