feat(gemini-cli): add proper User-Agent and X-Goog-Api-Client headers

Match native GeminiCLI client fingerprint to avoid upstream rejection.
Also fix base executor to call transformRequest before buildHeaders so
subclasses can store model context for header generation.

Made-with: Cursor
This commit is contained in:
Peter Steinberger
2026-03-10 16:38:32 +07:00
committed by decolua
parent 10b22d1318
commit 06a5307160
3 changed files with 35 additions and 3 deletions
+1 -1
View File
@@ -84,8 +84,8 @@ export class BaseExecutor {
for (let urlIndex = 0; urlIndex < fallbackCount; urlIndex++) {
const url = this.buildUrl(model, stream, urlIndex, credentials);
const headers = this.buildHeaders(credentials, stream);
const transformedBody = this.transformRequest(model, body, stream, credentials);
const headers = this.buildHeaders(credentials, stream);
if (!retryAttemptsByUrl[urlIndex]) retryAttemptsByUrl[urlIndex] = 0;