dsh-gemini-oauth-bridge
In a curated listMaintenance: Activehyqhyq3/dsh-gemini-oauth-bridge
Bridge Google AI subscription (Antigravity/Gemini OAuth) into DeepSeek Harness as an OpenAI-compatible endpoint
$ dsh plugin add dsh-gemini-oauth-bridgeInstall
dsh has no central install command — add this plugin’s entry (documented in its README) to your profile or patch config, then restart.
How installs work11
stars
5
forks
JavaScript
Language
MIT
License
2026-09-03
Created
2026-11-09
Last push
README
dsh-gemini-oauth-bridge
English | 简体中文
Bridges a Google AI subscription (AI Pro / AI Ultra, via the Antigravity / Code Assist OAuth surface) into an OpenAI-compatible endpoint that DeepSeek Harness (DSH) can use directly as a model provider.
Important boundary: Google AI subscription developer quotas only cover the AI Studio web UI and OAuth login inside official CLI tools (Gemini CLI / Antigravity); API-key usage is billed separately. This plugin speaks the same OAuth surface as the official client, so it consumes subscription quota rather than API credit — but that also means it is not a Google-sanctioned third-party integration. Account risk / breakage is possible; evaluate for yourself.
Features
- Login and go: one-click Google OAuth from Settings → Gemini OAuth (authorization code + loopback callback), with automatic
loadCodeAssistregistration /onboardUseronboarding and upstream model discovery. - OpenAI-compatible endpoint:
/gemini-oauth-bridge/v1/chat/completions(streaming SSE + non-streaming) and/v1/models(so DSH can discover models). - Full protocol translation: system messages, multimodal (data-URL images), function calling (tool_calls ↔ functionCall/functionResponse),
reasoning_content(thinking stream), usage stats, finish-reason mapping. - Gemini 3 thought-signature replay: the server remembers upstream
thoughtSignaturevalues by tool-call id and re-attaches them to functionCall parts on the next turn — OpenAI format carries no signatures, and Gemini 3 multi-turn tool calls fail without replay. - Subscription-friendly (anti-drift): dynamically tracks the latest shipping Antigravity client version for the User-Agent (stale versions are rejected for newer models); requests carry
requestType: "agent", a stable derivedsessionId, andagent-<uuid>request IDs; keep-alive connections withoutConnection: close. - 429 cooldowns: parses upstream
Retry-After/retryDelay, enters a per-model cooldown window, and refuses requests locally during it instead of hammering upstream. - Catalog honesty: an entry the upstream catalog flags
disabled: true— e.g.gemini-4-argon-disabled("Unavailable" / "available to Ultra and paid Pro plan subscribers") — is never published as a DSH model, so the picker cannot offer something that can only fail. A request for an id the account cannot use returns the upstream's own explanation plus a refresh hint instead of an opaque404 Requested entity was not found. Per-model context/output limits are read from the upstreammaxTokens/maxOutputTokensfields. - Browser-trust fence: a plugin prefix route is dispatched before DSH's own Host/Origin fence, so the bridge enforces its own — the
Hostmust be an authority it serves (loopback by default), aSec-Fetch-Site: cross-siterequest, an opaqueOrigin: null, or anOriginthat disagrees with theHostis refused with 403, and a request carrying noHostat all is only accepted from a loopback peer. - Tabbed settings page: the section splits into Overview / Quota / Usage / Models panels, each carrying only its own actions (refresh client version, refresh quota, refresh model list, sign out). All four panels survive a sign-out: Quota and Usage explain what signing in would reveal, and Models shows a sign-in hint instead of the model list, because available models depend on the account's plan and the list endpoint needs a token — so losing the token never collapses the page back to the single-pane layout, and never leaves a stale list from a previous account on screen.
- Subscription quota display: queries
v1internal:retrieveUserQuotaSummarywhen opening Settings → Gemini OAuth and, at most once a minute, after a completed chat turn; a two-minute cache backs the status poll, so a busy conversation does not spend one upstream request per turn. Each pool shows its Weekly limit (weekly) and 5-hour limit (5h) remaining percentage, progress bar, reset time and refresh timestamp, with a one-click Refresh quota action. - Model family & thinking-effort grouping: collapses multi-effort upstream variants (
*-low,*-medium,*-high, etc.) into a single base model entry withreasoningEffortsin DSH (llm-pi-ai), so you pick the model first and the thinking effort second;/v1/chat/completionsresolves(model, reasoning_effort)back to the concrete upstream ID. - One catalogue, two doors:
GET /v1/modelsapplies the same publishable filter and the same effort grouping as the provider document and reports each entry's context/completion limits, so a discovery pass can never hand DSH a different list than the route actually serves. - Local usage dashboard: records per-call requests (succeeded / failed / 429 rate-limited) and prompt/completion tokens into local day and hour buckets, then renders KPI cards, a token bar + call-count line trend chart, a per-model share donut, and a per-model table. The chart drills down by click — weeks → days → the day's 24 hours — via a single Back up link. No tooltip layer sits on top: hovering a bar feeds that bucket's numbers to the KPI cards and the panel heading, and leaving the chart restores the period totals.
- Single-flight token refresh: access tokens auto-renew 120 s before expiry; concurrent requests share one refresh.
Install
dsh plugin --profile web add github:hyqhyq3/dsh-gemini-oauth-bridge
# or a local checkout
dsh plugin --profile web add link:/path/to/dsh-gemini-oauth-bridge
Restart dsh --profile web, then open Settings → Gemini OAuth.
Usage
More in Security & Auth
dsh-uumit-remote
by uumit-ai
Connect to DSH from another device and selectively share the remote instance with invited users.
dsh-auto-review
by perrylink
Second-model AI auto-review for DeepSeek Harness approval requests: a read-only reviewer subagent returns structured allow/deny verdicts with reasons, fail-closed by default, fully auditable from the session log (approval/asked -> autoReview/verdict -> approval/decided).
cc-safety-net
by kenryu42
A pre-execution guard for AI coding agents. It blocks destructive Git and file system commands, plus common attempts to access sensitive files, before a tool call runs. Supports Amp Code, Antigravity CLI, Claude Code, Codex, Cursor, DeepSeek Harness, Devin CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, Kimi Code, OpenClaw, OpenCode, and Pi.
dsh-permission-rules
by perrylink
Claude Code-style declarative permission rules for DeepSeek Harness: ordered allow/deny/ask rules with tool-name, argument (glob/regex), and workspace-path matching on the tools/pre-execute waterfall, session-log audit, and HMR reload.
