Repository navigation
Releases
Releases · ShawTim/gemini-app2api
v1.8.0 — Native Windows Support, Strict Responses Proxy Fix & State-Machine Refactor
Highlights
- Native Windows (
win32) Support &windows-latestCI (Fixes #5):- Kernel-backed single-instance locking on Windows via libuv
UV_FS_O_EXLOCK(dwShareMode = 0) on a persistent.state.lockhandle with an immediate fail-closedEBUSYself-probe (zero PID-reclamation races or PID-reuse lockouts). - Locale-independent SID-based
icacls.exeACL hardening (*S-1-5-18,*S-1-5-32-544, and current localS-1-5-*/ Entra IDS-1-12-1-*user SID), boundedrenameSyncretry on transient DefenderEPERM/EACCES/EBUSY,SIGBREAKhandling, andpathToFileURL+ Winsock env fixes inscripts/run-current-contract.mjs. - Verified on GitHub Actions
windows-latest(current-contract+windows-nativeNTFS lock, cross-process contention, forced-kill recovery, 4-way race,.env, and loopback/healthchecks).
- Kernel-backed single-instance locking on Windows via libuv
- Strict Responses Proxy Compatibility (Fixes #6):
- Qualified usable
POST /v1/responsesSSEresponse.completedevents now always emitresponse.error: nullwhile preservingincomplete: true,incomplete_details: { reason: "upstream_interrupted", code }, andres.incomplete = true(preventing resumption cache retention)—stopping reconnect loops on strict OpenAI Responses proxies (e.g., Codex Desktop via Cockpit Tools). response.failed,response.incomplete, and non-streaming partial responses keeperrorintact.
- Qualified usable
- Sticky Session & Image Blob Cache Preservation:
- Verified
post_toolandpost_outputidle stalls no longer poisonsession.lastFailureor thrash per-account imageblobCacheon subsequent turns;X-Gemini-Recovery-Errorsis only emitted on actual retry attempts.
- Verified
- State-Machine Refactor & Strict JSON Recovery:
- Closed, privacy-safe
TOOL_JSON_REASONSsyntax subcodes inparseBoundedJson()with targeted recovery directives appended at the prompt tail and 2 uncommittedtool_protocolretries across Gateway, Pi, and OpenCode. - Converged
response-delivery.mjsonto monotonic 4-statewirePhase, replaced O(N^2) per-frame idle probing innative-provider.mjswith O(1)classifyIdleSnapshot()+ pureselectIdleDeadline(), unifiedpool.mjsretry planning in pureplanRetry(), fixed OpenCodepost_toolstall handling, and added committed multi-call tail salvage in Pi/OpenCode. - Added synthetic 150K-token HTTP/2 adversarial long-context suite (
test/gateway-long-context-adversarial.test.mjs).
- Closed, privacy-safe
Extension Packages
pi-gemini-app@0.1.11openclaw-gemini-app@0.1.7mcp-gemini-app@0.1.2opencode-gemini-app@0.1.2
v1.7.1 — Keepalive Headers, Idle Anchoring, HTTP/2 Watchdog & Large Image Upload Recovery
Highlights
Streaming & Timeout Reliability
- 45s Comment-Only SSE Keepalive Headers (
/v1/chat/completions): Flushes HTTP200 text/event-stream+: keepaliveheartbeats at 45s while buffering large slowtool_callblocks (20–35 KB), preventing 300s client/SDK header timeouts without committing output or breaking uncommitted retry safety. - Anchored Idle Timers (No Infinite Waits): Locks
post_complete,post_tool,post_output, andpost_tool_errordeadlines to actual text/completion progress so repeated duplicate or metadata-only frames can never reset idle timers forever. - Smarter Tool-Block Idle Probing: Distinguishes
tool_choice: 'required'preambles and still-streaming 2nd tool calls (TRUNCATED_TOOL_CALL) from closed invalid tool blocks, preventing premature cancellations while promptly closing stalled malformed tool calls. - HTTP/2 PING ACK Watchdog (30s): Detects unresponsive upstream HTTP/2 sessions cleanly with
client.connectingguards,ERR_HTTP2_PING_CANCELhandling, and monotonic sequence tracking.
Large Image Upload Stability
- Byte-Budget Upload Pacing (4 MiB In-Flight Cap): Keeps small images uploading in parallel while automatically pacing multi-megabyte PNG bursts (e.g., 4–7 × 2.9 MiB screenshots) so they no longer overwhelm a single HTTP/2 upload session.
- Incremental Blob Caching & Sequential Reset Retry: Preserves completed uploads immediately in
blobCacheviaonUploaded, retries remaining uncached images on fresh HTTP/2 sessions (concurrency: 1), and classifiesNATIVE_IMAGE_UPLOAD_RESETfor gateway-level transient failover.
Tool Protocol & Test Speed
- Mid-Stream Tool Error Recovery: Defers mid-stream
TOOL_ERRORStovalidatewith exactpostFenceOffsettracking and a shared 1-retrytool_protocolcap. - Parallel Offline Product Suite: Runs the 75-file offline product suite in a bounded parallel worker pool (~4.6× faster).
Updated Extension Packages (npm)
pi-gemini-app@0.1.10openclaw-gemini-app@0.1.6mcp-gemini-app@0.1.1opencode-gemini-app@0.1.1
Verification
- Offline pre-release checks: 6/6 current-contract, 75/75 product tests, 71/71 Playwright browser E2E, 3/3 Python SDK smoke, 5/5 release package checks.
- Live real-upstream verification: 4 × 2.9 MiB PNGs, 24-image (~24 MiB) batch,
tool_choice: 'required', 28.9 KB slow tool call with 45s SSE keepalive flush, GatewayPOST /mcp,mcp-gemini-app(gateway proxy & standalone direct stdio), andopencode-gemini-appon OpenCode1.19.6.
v1.7.0 — Native Gateway POST /mcp, Trilingual Admin UI (EN/繁/简), Standalone MCP & OpenCode Plugins, and Pi 1.5.2 Session Affinity
Highlights
Native Gateway Streamable HTTP MCP (POST /mcp) & stdio Bridge (bin/gemini-gateway mcp)
- Added an in-process, API-key-authenticated Streamable HTTP JSON-RPC 2.0 MCP endpoint at
POST /mcpexposingask_gemini(with inlinedata:image support and LFI blocking ofimages[].path),gemini_search(groundednative_search+ formatted Markdown citations), andgemini_quota(sanitized pool-level summary with zero emails, labels, tokens, or account IDs). - Enforced DNS-rebinding
Originallowlist (403 ORIGIN_REJECTED),MCP-Protocol-Versionvalidation (2025-06-18/2025-03-26/2024-11-05), strict JSON-RPC-32700/-32600responses, raw-bytemaxPromptBytesenforcement before image decoding, and a persistedmcpEnabledsetting (403 MCP_DISABLEDwhen disabled without affecting/v1/*). - Added
bin/gemini-gateway mcpstdio bridge with HTTPS enforcement for non-loopback hosts, cwd.envisolation, bounded concurrency (8), typed JSON-RPC request-ID tracking, and clientnotifications/cancelledaborts.
Trilingual Admin UI (English / 繁體中文 / 简体中文) & MCP Controls
- Added a compact 3-language switcher (
EN | 繁 | 简) with full Simplified Chinese (zh-CN) localization across all Admin Console views and a completeREADME.zh-CN.md. - Added MCP Quick Connect (
MCPpreset), Client Setup (MCP EndpointURL + status badge + strict JSONMCP (HTTP)with"type": "http"and local-pathMCP (stdio)tabs), API Keys dual/v1+/mcpendpoint strip, SettingsEnable MCP Streamable HTTP endpointswitch, and/mcprequest telemetry & onboarding recognition.
Standalone Zero-Dependency Extensions (extensions/mcp, extensions/opencode)
- Added
mcp-gemini-app@0.1.0: zero-dependency Node.js>=22stdio MCP server with fail-closedowner-tagged credential isolation, serialized.reclaimcross-process locking + pre-refresh inode-pinnedO_RDWRupdates, read-only external Pi auth support, retry account-epoch pinning,O_NONBLOCK | O_NOFOLLOWlocal image loading, and explicit--accept-termsToS opt-in. - Added
opencode-gemini-app@0.1.0: zero-dependency Bun/Node OpenCode provider plugin with loopback & remote OAuth flows, explicitGEMINI_OPENCODE_ACCEPT_TERMS=1opt-in, per-loader isolated tier resolution beforegemini-autoselection, post-tier-probe account identity verification, retry account-epoch pinning, deferred SSE error responses, andReadableStream.cancel()upstream abort.
Pi 1.5.2 Session Affinity (Fixes #4)
- Recognized hyphenated
session-idin explicit session header resolution (x-session-id→x-session-affinity→session-id→session_id) with strictINVALID_SESSION_IDvalidation. - Updated Pi
User-Agentmatching to support versionedpi/<version> (...)/pi/<version>headers (e.g.pi/1.5.2 (win32; node/v24.13.0; x64)) forprompt_cache_keyfallback affinity.
Verification
- Full offline pre-release suite passed: 75/75 staged product tests, 71/71 Playwright browser tests (390px + 1440px, light/dark, EN/繁/简), Python + JS SDK smoke tests, all 5 package release checks, and live 9-account gateway affinity verification.
- Multi-arch Docker image (
linux/amd64,linux/arm64) published toghcr.io/shawtim/gemini-app2api:v1.7.0and:latest.
Full Changelog: v1.6.6...v1.7.0
v1.6.6 — Responses Multimodal function_call_output with Tool-Image Attribution (Fixes #3)
Fixes
- Responses
function_call_outputMultimodal Arrays (src/openai-contract.mjs,src/openai-usage.mjs, Fixes #3 — thanks @xiao398008!):- Accepted array
outputonPOST /v1/responsesfunction_call_outputitems containinginput_textandinput_imageparts (matching OpenAI Responses &pi-ai'sconvertToolResultOutput), while strictly rejecting invalid part types (output_text, baretext,logprobs,annotations,parsed) and non-string/non-arrayoutput(INVALID_TEXT). - Preserved exact interleaved text positions and parallel tool-call attribution by inserting
[Tool image N for <call_id>]markers in each tool result and flushing deferred tool images together as a labeleduserimage turn immediately after each consecutivefunction_call_outputgroup (avoidingPENDING_TOOL_CALLSon parallel tool calls). - Added
function_call_outputinput_imageslots torequestBudget()(256 MiB image budget / sharedMAX_IMAGES = 256cap) andmeasurePromptImagePayload()(258 tokens/image), and deduplicated inline base64 image decoding per request insrc/image-input.mjs+src/openai-contract.mjs(4× → 1× decode). - Verified with offline unit/HTTP tests and live E2E against
gemini-neonusing both the exact Issue #3 payload (200 OK) and parallel multi-image attribution (call_a=red, call_b=blue).
- Accepted array
Internal Refactors
- Consolidated
NATIVE_VERSION(1.135.1.1291),GATEWAY_USER_AGENT(gemini-app2api/1.0), and sharedMODEL_SPECSacross Gateway, Pi, and OpenClaw with drift-prevention tests (5a1370b).
Note:
pi-gemini-app@0.1.9andopenclaw-gemini-app@0.1.5do not require version bumps for this release.
Full Changelog: v1.6.5...v1.6.6
v1.6.5 — Dynamic Gateway & Admin UI Version Reporting (Fixes #2)
Fixes
- Dynamic Package Version (
src/gateway/app.mjs,scripts/live-acceptance.mjs): Replaced hardcoded"1.5.3"version strings inoverview(),GET /health(and/admin/api/diagnostics), andscripts/live-acceptance.mjswith dynamic reads frompackage.jsonso the Admin UI, health probe, and diagnostics always report the installed release version. Fixes #2 (thanks @kyop21!). - Admin UI Version Pill Cleanup (
src/admin-v2/app.js): Removed the stale'1.5.3'fallback inversionTag()(hiding the version pill until/admin/api/overviewfinishes loading) and updated demo mode's synthetic version label to'demo'. - Regression Tests (
test/gateway-http.test.mjs,test/admin-v2-static.test.mjs): Added assertions verifyingGET /health,GET /admin/api/overview, andversionTag()matchpackage.jsonwith zero stale version literals.
Note:
pi-gemini-app@0.1.9andopenclaw-gemini-app@0.1.5are unchanged in this release.
Full Changelog: v1.6.4...v1.6.5
v1.6.4 — OpenClaw OAuth Login Hotfix, 8,192 Message Limit & Accurate Image Token Usage
Highlights
- Critical OpenClaw OAuth Login Hotfix (
openclaw-gemini-app@0.1.5):- Fixed OAuth login displaying
visit: undefinedby readingsession.authorizationUrlfromstartLoopbackLogin()(with an explicit non-empty URL guard). - Added the required post-login scoped token exchange (
refreshNativeCredential(config, tokens.refreshToken)) to acquireassistant/geminiscopes before terms acceptance, quota/tier detection, and generation. - Fixed swapped
(cred.refresh, config)arguments inrefreshOpenClawOAuth, covered by a real-loopback + real-refresh integration test (test/openclaw-extension.test.mjs).
- Fixed OAuth login displaying
- Long-Session Message Limit (
MAX_MESSAGES = 8,192): RaisedMAX_MESSAGESfrom1,024to8,192andrequestBudget()JSON node limit from32,768to131,072(src/openai-contract.mjs), returning standard413 REQUEST_TOO_LARGE(param: "messages"/"input") on overflow instead of misleading400 MESSAGES_REQUIRED. - Accurate Image Token Estimation (
pi-gemini-app@0.1.9, Gateway & OpenClaw): Excluded base64image_url/input_imagedata strings frompromptCharsand billed a fixed258tokens per image (src/openai-usage.mjs,src/gateway/app.mjs,src/gateway/response-delivery.mjs,extensions/pi/stream.js) so multi-screenshot sessions no longer inflateusage.prompt_tokens.
Packages & Docker
- Gateway:
gemini-app2api@1.6.4·ghcr.io/shawtim/gemini-app2api:v1.6.4(linux/amd64, linux/arm64) - OpenClaw Plugin:
openclaw-gemini-app@0.1.5 - Pi Extension:
pi-gemini-app@0.1.9
Full Changelog: v1.6.3...v1.6.4
v1.6.3 — Clean Short-Reply Stall Recovery, Safe Deliverable Watchdogs & Extension Parity
Highlights
- Clean Short-Reply Stall Recovery (
< 2,048 B): When upstream finishes streaming verified plain text (modeandattributionverified, no unclosedtool_callfence, tool choice satisfied, no refusal/soft-error, valid structured JSON) and stalls without sendingcompleted: true/END_STREAM, the gateway flushes the reply on attempt 1 withfinish_reason: "stop",incomplete: true, anddata: [DONE]— eliminatingshortOutputRetryand client 300s headers-timeout retry loops. - Standalone Pi & OpenClaw Extension Parity:
extensions/pi/stream.js(bundled intopi-gemini-app@0.1.8andopenclaw-gemini-app@0.1.4) now finishes verified post-tool and post-output idle stalls cleanly withdone(toolUse/stop) instead of raising retryable errors. - Tighter, Safe Deliverable-Only Idle Watchdogs: Tuned
src/native-provider.mjsdefaults to2s(postCompleteGraceMs),6s(postToolIdleMs), and15s(postOutputIdleMs), strictly gated so idle timers only arm once verified, complete, deliverable output already exists — preventing premature504 -> 422 GENERATION_FAILEDaborts during slow mid-tool_call, mid-JSON, or prefill pauses. - One-Command Extension Publishing Scripts: Added
npm run publish:pi,publish:openclaw:npm,publish:openclaw:clawhub,publish:openclaw, andpublish:extensionstopackage.json.
Packages & Docker
- Gateway:
gemini-app2api@1.6.3·ghcr.io/shawtim/gemini-app2api:v1.6.3(linux/amd64, linux/arm64) - Pi Extension:
pi-gemini-app@0.1.8 - OpenClaw Plugin:
openclaw-gemini-app@0.1.4
Full Changelog: v1.6.2...v1.6.3
v1.6.2 — Long-Context Streaming Resilience, Idle Watchdogs & reasoning_content Compat
Highlights
- SSE Keepalive Heartbeats: Emits periodic
15sSSE: keepalive\n\ncomments on live streams (src/gateway/response-delivery.mjs,SharedResponse.writeKeepaliveinsrc/gateway/request-resumption.mjs) without polluting replay buffers, preventing Node.jsundici300sbodyTimeout(TypeError: terminated) drops during long prefill/thinking turns. - Graceful Deadline Flush: Gives
delivery.interrupt()a 2-second grace window on healthy sockets atREQUEST_DEADLINE(src/gateway/app.mjs) to flushfinish_reason: "tool_calls"/"stop",incomplete: true, anddata: [DONE]cleanly instead of resetting the TCP socket. - Post-Tool Hallucination Early-Stop: Immediately cancels upstream generation (
turn.cancel()) whenliveSplitter.suppresseddetects a hallucinated[Caller tool result]after valid tool calls (src/tool-protocol.mjs,src/native-provider.mjs), shared across Gateway,pi-gemini-app@0.1.7, andopenclaw-gemini-app@0.1.3. - Bounded Upstream Idle Watchdogs: Handles stalled Google Robin streams in
src/native-provider.mjswithout affecting prefill/thinking silence or< 2,048 Bshort replies:postCompleteGraceMs(8s): finishes verified completed turns cleanly when upstream omitsEND_STREAM.postToolIdleMs(15s): flushes committedtool_callscleanly when upstream stalls after emitting tool calls.postOutputIdleMs(45s): flushes committed>= 2,048 Btext cleanly when upstream stalls mid-reply (never tripping short< 2,048 Bprefix-gated replies into retry loops).
- OpenClaw & Reasoning Client Compatibility: Accepts and strips optional
reasoning_content/reasoning(string | null) fields on replayedassistantmessages (src/openai-contract.mjs), fixing400 UNSUPPORTED_PARAMETER: messages.reasoning_content. - Streamlined Bilingual READMEs: Focused
README.mdandREADME.zh.mdfor faster 30-second onboarding.
Packages & Docker
- Gateway:
gemini-app2api@1.6.2·ghcr.io/shawtim/gemini-app2api:v1.6.2(linux/amd64, linux/arm64) - Pi Extension:
pi-gemini-app@0.1.7 - OpenClaw Plugin:
openclaw-gemini-app@0.1.3
Full Changelog: v1.6.1...v1.6.2
v1.6.1 — Multi-Image E2E Pipeline (Lifted 4-Image/2 MiB Caps, Parallel HTTP/2 Uploads & Per-Account Blob Cache)
Highlights
- Lifted Artificial
4-Image /2 MiBCaps Across Gateway, Pi & OpenClaw Extensions:- Raised image safety bounds across the HTTP Gateway (
src/image-input.mjs,src/openai-contract.mjs,src/gateway/image-upload.mjs,native-wire/robin-current.mjs),pi-gemini-app@0.1.6, andopenclaw-gemini-app@0.1.2(extensions/pi/transcript.js) to256images,20 MiBper image, and256 MiBcombined decoded bytes, after live Robin verification confirmed32+multi-image batches and10 MiB+single PNG uploads. Non-image prompt text/JSON remains strictly bounded at4 MiB. - Raised default HTTP JSON
maxBodyBytesfrom4 MiBto128 MiB(max256 MiB) insrc/gateway/state.mjs, automatically upgrading untouched legacy4 MiBdefaults on restart while respecting explicit custom overrides.
- Raised image safety bounds across the HTTP Gateway (
- Parallel HTTP/2 Image Uploads & Per-Account In-Memory
blobIdCache:- Upgraded
uploadNativeImages(src/gateway/image-upload.mjs) to multiplex concurrent HTTP/2 uploads (concurrency = 8, preserving exact attachment ordering) with upload timeouts scaled to the request deadline (up to180sper turn /600smax). - Added a lightweight, strictly isolated ephemeral in-memory
ImageBlobCache((accountId, tokenFingerprint, mimeType, sha256) -> blobId,15 minTTL, max2,048entries, never storing image bytes or persisting to disk) acrosssrc/native-provider.mjsandextensions/pi/stream.js—eliminating redundant screenshot re-uploads across multi-turn E2E runs with transparent single-shot eviction and fresh re-upload fallback if a cachedblobIdexpires before frames arrive.
- Upgraded
Verification
npm run test:prerelease+ CI offline gates (docker-copy-closure-offline,historical-entry-gate-offline): ALL PASS (verify-offline-product-runner70 files,test:current-contract6/6,test:product70/70,test:browser70/70 Playwright,test:python,docker build+test:docker, andtest:releaseincl.pi-gemini-app@0.1.6+openclaw-gemini-app@0.1.2).
Full Changelog: v1.6.0...v1.6.1
v1.6.0 — Standalone OpenClaw Provider Plugin (openclaw-gemini-app) & Retryable 503 SERVER_SHUTDOWN
Highlights
- Standalone Zero-Dependency OpenClaw Provider Plugin (
openclaw-gemini-app@0.1.1):- Published on npm (
openclaw-gemini-app) and ClawHub (openclaw plugins install npm:openclaw-gemini-app). - Manifest-first
openclaw.plugin.jsonregisteringgemini-appwith 512kgemini-neon/gemini-hydrogen, 128kgemini-flash-lite/gemini-auto,gemini-argon→gemini-neonalias normalization, and automatic Free-tier model filtering. - Local browser and remote VPS copy-paste OAuth login with automatic ToS acceptance,
refreshOAuth, OpenClawrequestAuthv1 fresh token resolution withassertCurrent(),/usagequota snapshots +/gemini-quota, failover & context-overflow classifiers, and full parity with 15s HTTP/2PINGkeepalives,HTTPS_PROXYtunneling, and 256-tool support. - Deterministic builder (
scripts/build-openclaw-package.mjs), verifier (scripts/check-openclaw-package.mjs, wired intonpm run test:release), and offline tests (test/openclaw-extension.test.mjs,test/openclaw-package-build.test.mjs), passing@openclaw/plugin-inspector(0 breakages, 0 issues) againstopenclaw@2026.11.6.
- Published on npm (
- Retryable
503 SERVER_SHUTDOWNon Gateway Restarts:- Fixed in-flight generation turns interrupted by gateway shutdown/restart (
src/gateway/app.mjs) to return standard retryable HTTP503(code: "SERVER_SHUTDOWN",type: "server_error",Retry-After: 2) instead of non-retryable499 invalid_request_error / NATIVE_TURN_ABORTED, with regression coverage intest/gateway-http.test.mjs.
- Fixed in-flight generation turns interrupted by gateway shutdown/restart (
- Visual Assets & Bilingual Docs:
- Added
docs/assets/openclaw-extension.jpg,docs/assets/extensions-overview.jpg, andopenclaw-gemini-appnpm badges acrossREADME.md,README.zh.md, andextensions/openclaw/README.md.
- Added
Verification
npm run test:prerelease: PASS (verify-offline-product-runner70 files,test:current-contract6/6,test:product70/70,test:browser70/70 Playwright,test:python,docker build+test:docker, andtest:releaseincl.pi-gemini-app@0.1.5+openclaw-gemini-app@0.1.1).
Full Changelog: v1.5.3...v1.6.0