Compare commits

...

3 Commits

Author SHA1 Message Date
Peter Steinberger
e8e5b633bd fix(gemini-cli-auth): use valid Linux platform enum (#32382) (thanks @riftzen-bit) 2026-03-03 02:35:50 +00:00
riftzen-bit
fd4e014854 chore: remove unreachable "LINUX" from resolvePlatform return type
Address review feedback: since resolvePlatform() no longer returns
"LINUX", remove it from the union type to prevent future confusion.
2026-03-03 02:35:30 +00:00
riftzen-bit
6b7c86467c fix(gemini-cli-auth): use PLATFORM_UNSPECIFIED for Linux in loadCodeAssist
Google's loadCodeAssist API rejects "LINUX" as an invalid Platform enum
value, causing OAuth setup to fail with 400 Bad Request on Linux systems.

The pi-ai runtime already uses "PLATFORM_UNSPECIFIED" for this field.
This aligns the extension's discoverProject() with that approach by
returning "PLATFORM_UNSPECIFIED" for Linux (and other non-Windows/macOS
platforms) instead of "LINUX".

Also fixes the original resolvePlatform() which incorrectly fell through
to "MACOS" as default instead of explicitly checking for "darwin".
2026-03-03 02:35:29 +00:00
3 changed files with 12 additions and 8 deletions

View File

@@ -49,6 +49,7 @@ Docs: https://docs.openclaw.ai
- Feishu/default account resolution: always honor explicit `channels.feishu.defaultAccount` during outbound account selection (including top-level-credential setups where the preferred id is not present in `accounts`), instead of silently falling back to another account id. (#32253) Thanks @bmendonca3.
- Gemini schema sanitization: coerce malformed JSON Schema `properties` values (`null`, arrays, primitives) to `{}` before provider validation, preventing downstream strict-validator crashes on invalid plugin/tool schemas. (#32332) Thanks @webdevtodayjason.
- Models/openai-completions developer-role compatibility: force `supportsDeveloperRole=false` for non-native endpoints, treat unparseable `baseUrl` values as non-native, and add regression coverage for empty/malformed baseUrl plus explicit-true override behavior. (#29479) thanks @akramcodez.
- Gemini CLI OAuth/Linux compatibility: send `PLATFORM_UNSPECIFIED` (instead of invalid `LINUX`) in `loadCodeAssist` metadata so Linux OAuth flows no longer fail with provider 400 enum errors. (#32382) Thanks @riftzen-bit.
- OpenAI/Responses WebSocket tool-call id hygiene: normalize blank/whitespace streamed tool-call ids before persistence, and block empty `function_call_output.call_id` payloads in the WS conversion path to avoid OpenAI 400 errors (`Invalid 'input[n].call_id': empty string`), with regression coverage for both inbound stream normalization and outbound payload guards.
- Gateway/Control UI basePath webhook passthrough: let non-read methods under configured `controlUiBasePath` fall through to plugin routes (instead of returning Control UI 405), restoring webhook handlers behind basePath mounts. (#32311) Thanks @ademczuk.
- CLI/Config validation and routing hardening: dedupe `openclaw config validate` failures to a single authoritative report, expose allowed-values metadata/hints across core Zod and plugin AJV validation (including `--json` fields), sanitize terminal-rendered validation text, and make command-path parsing root-option-aware across preaction/route/lazy registration (including routed `config get/unset` with split root options). Thanks @gumadeiras.

View File

@@ -239,14 +239,15 @@ describe("loginGeminiCliOAuth", () => {
"GOOGLE_CLOUD_PROJECT_ID",
] as const;
function getExpectedPlatform(): "WINDOWS" | "MACOS" | "LINUX" {
function getExpectedPlatform(): "WINDOWS" | "MACOS" | "PLATFORM_UNSPECIFIED" {
if (process.platform === "win32") {
return "WINDOWS";
}
if (process.platform === "linux") {
return "LINUX";
if (process.platform === "darwin") {
return "MACOS";
}
return "MACOS";
// Matches updated resolvePlatform() which uses PLATFORM_UNSPECIFIED for Linux
return "PLATFORM_UNSPECIFIED";
}
function getRequestUrl(input: string | URL | Request): string {

View File

@@ -224,14 +224,16 @@ function generatePkce(): { verifier: string; challenge: string } {
return { verifier, challenge };
}
function resolvePlatform(): "WINDOWS" | "MACOS" | "LINUX" {
function resolvePlatform(): "WINDOWS" | "MACOS" | "PLATFORM_UNSPECIFIED" {
if (process.platform === "win32") {
return "WINDOWS";
}
if (process.platform === "linux") {
return "LINUX";
if (process.platform === "darwin") {
return "MACOS";
}
return "MACOS";
// Google's loadCodeAssist API rejects "LINUX" as an invalid Platform enum value.
// Use "PLATFORM_UNSPECIFIED" for Linux and other platforms to match the pi-ai runtime.
return "PLATFORM_UNSPECIFIED";
}
async function fetchWithTimeout(