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:
saurabh321gupta
2026-06-13 11:43:12 +07:00
committed by decolua
parent 0c7c9de00a
commit d652300e9e

View File

@@ -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 });
}