mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
* feat(providers): Gemini CLI provider — ModelProvider.GEMINI Mirrors the grok blueprint with source-verified divergences (all facts pinned against google-gemini/gemini-cli @ 9681621c): no refresher daemon — Google's refresh tokens are reusable, so the RO host mount is COPIED to a writable container-local ~/.gemini and each container refreshes in-process independently (the write-back crash risk on RO never triggers); settings.json renders security.auth.selectedType 'oauth-personal', experimental.enableAgents=false (subagent ban), autoConfigureMemory=false with a bounded heap; tool scoping rides the tiered TOML Policy Engine (deny-only rules that yolo mode structurally cannot beat); gemini -p with --output-format stream-json; usage parsed from the run's own stdout stats — the adversarial pass caught the parser reading the json-mode nested shape while the entrypoint runs stream-json's FLAT shape (every real run would have priced $0 forever, hidden by fixtures sharing the assumption) — now flat-primary with the nested shape as cited fallback; rate-limit classified from structured error.type only (model-echo immune), native exit 41 auth passthrough; per-model pricing for the three GA models; migrations 084 (enum) + 085 (seed) complete the 082-085 finale chain. V1 excludes interactive intake/secretary. Stack-merge required two behavior-preserving complexity refactors in the shared park/usage plumbing (a park-pair loop; a usage-reader dispatch dict). * fix(providers): route gemini usage read through the containment barrier Mirrors the codex/grok fix — _gemini_usage_json now delegates to _read_usage_json_contained, so CodeQL's path-injection alert on the gemini read is resolved by the same resolve-and-contain guard. --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
49 lines
2.4 KiB
Docker
49 lines
2.4 KiB
Docker
# Gemini (Google) Agent Image
|
|
# =============================================================================
|
|
# Runs Gemini through Google's official `gemini` CLI, authenticated by an OAuth
|
|
# login via a mounted ~/.gemini/oauth_creds.json — the parity analogue of the
|
|
# Claude Code path's mounted ~/.claude and the grok path's mounted ~/.grok (no
|
|
# metered API key). Reuses the base image's roboco venv + uv + the RoboCo MCP
|
|
# gateway servers, and the base image's Node.js 22 (the CLI needs node >= 20).
|
|
# The entrypoint copies the staged read-only OAuth credential into a writable
|
|
# ~/.gemini, renders ~/.gemini/settings.json + a Policy Engine TOML from the
|
|
# mounted mcp-config.json (see roboco.llm.providers.gemini_cli_config), and
|
|
# runs the CLI headless. One runtime image serves every role — role behaviour
|
|
# comes from the mounted system prompt / manifest / mcp-config, exactly as on
|
|
# the Claude/grok paths.
|
|
# =============================================================================
|
|
|
|
FROM roboco-agent-base
|
|
|
|
USER root
|
|
|
|
# Install the official Gemini CLI. Pinned — untrusted model output runs under
|
|
# it, so bump the version deliberately, never float (spike verified 0.52.0 at
|
|
# github.com/google-gemini/gemini-cli @ 9681621c). npm installs to the global
|
|
# node_modules the base image's Node 22 already resolves onto PATH.
|
|
ARG GEMINI_CLI_VERSION=0.52.0
|
|
RUN npm install -g "@google/gemini-cli@${GEMINI_CLI_VERSION}" \
|
|
&& npm cache clean --force \
|
|
&& rm -rf /root/.npm /tmp/* \
|
|
&& gemini --version
|
|
|
|
# Entrypoint: copy the staged OAuth credential into a writable ~/.gemini,
|
|
# render settings.json + policy TOML, then run gemini headless (overrides the
|
|
# base image's `claude` entrypoint). Owned by agent (mirrors the grok image).
|
|
COPY docker/scripts/gemini-cli-agent-entrypoint.sh /app/scripts/gemini-cli-agent-entrypoint.sh
|
|
RUN chmod 0755 /app/scripts/gemini-cli-agent-entrypoint.sh \
|
|
&& mkdir -p /home/agent/.gemini \
|
|
&& chown -R agent:agent /home/agent/.gemini
|
|
|
|
USER agent
|
|
|
|
LABEL role="gemini-cli-runtime"
|
|
LABEL description="Gemini (Google) agent runtime — Gemini Build via the official gemini CLI"
|
|
|
|
# advanced.autoConfigureMemory=false (rendered into settings.json) pins Node's
|
|
# heap sizing away from auto-detection against a shared host; this bounds it
|
|
# explicitly instead. Tunable per-deploy without a rebuild.
|
|
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
|
|
|
ENTRYPOINT ["/app/scripts/gemini-cli-agent-entrypoint.sh"]
|