[claude] Stand up Gemini harness as network worker (#748) #811

Merged
claude merged 1 commits from claude/issue-748 into main 2026-04-04 01:41:54 +00:00
Member

Fixes #748

What this does

Adds nexus/gemini_harness.py — a Hermes/OpenClaw harness worker backed by the Gemini API, following the same pattern as Ezra, Bezalel, and Allegro.

Timmy (sovereign)
  ├── Ezra       (harness)
  ├── Bezalel    (harness)
  ├── Allegro    (harness)
  └── Gemini     (harness — this PR)

Acceptance criteria

  • New harness instance backed by Gemini API (OpenAI-compat endpoint)
  • Exposed to network via HTTP server (--serve --port 9300): /generate, /generate/code, /health, /status, /context
  • Registered in sovereign-orchestration via register_in_orchestration()
  • Text gen, multimodal (images), code gen, streaming all supported
  • Context caching with configurable TTL
  • Fallback chain: gemini-2.5-pro-previewgemini-2.0-progemini-2.0-flash
  • Latency, token count, and cost logged per call + emitted to Hermes WS
  • 48 unit tests, all passing

Key files

  • nexus/gemini_harness.py — harness implementation
  • tests/test_gemini_harness.py — 48 unit tests (live API tests gated on RUN_LIVE_TESTS=1)

Usage

# Single call
python -m nexus.gemini_harness "What is sovereignty?"

# Serve on network
python -m nexus.gemini_harness --serve --port 9300

# Code gen
python -m nexus.gemini_harness --code "Write a fizzbuzz in Python"
Fixes #748 ## What this does Adds `nexus/gemini_harness.py` — a Hermes/OpenClaw harness worker backed by the Gemini API, following the same pattern as Ezra, Bezalel, and Allegro. ``` Timmy (sovereign) ├── Ezra (harness) ├── Bezalel (harness) ├── Allegro (harness) └── Gemini (harness — this PR) ``` ## Acceptance criteria - ✅ New harness instance backed by Gemini API (OpenAI-compat endpoint) - ✅ Exposed to network via HTTP server (`--serve --port 9300`): `/generate`, `/generate/code`, `/health`, `/status`, `/context` - ✅ Registered in sovereign-orchestration via `register_in_orchestration()` - ✅ Text gen, multimodal (images), code gen, streaming all supported - ✅ Context caching with configurable TTL - ✅ Fallback chain: `gemini-2.5-pro-preview` → `gemini-2.0-pro` → `gemini-2.0-flash` - ✅ Latency, token count, and cost logged per call + emitted to Hermes WS - ✅ 48 unit tests, all passing ## Key files - `nexus/gemini_harness.py` — harness implementation - `tests/test_gemini_harness.py` — 48 unit tests (live API tests gated on `RUN_LIVE_TESTS=1`) ## Usage ```bash # Single call python -m nexus.gemini_harness "What is sovereignty?" # Serve on network python -m nexus.gemini_harness --serve --port 9300 # Code gen python -m nexus.gemini_harness --code "Write a fizzbuzz in Python" ```
claude added 1 commit 2026-04-04 01:41:34 +00:00
feat: Stand up Gemini harness as network worker instance (Fixes #748)
Some checks failed
CI / validate (pull_request) Has been cancelled
05182c85b9
Add nexus/gemini_harness.py — a Hermes/OpenClaw harness backed by the
Gemini API, following the same pattern as Ezra, Bezalel, and Allegro.

Features implemented:
- Text, code, and multimodal (image) generation via Gemini OpenAI-compat API
- Streaming response support (stream_generate)
- Model fallback chain: gemini-2.5-pro-preview → gemini-2.0-pro → gemini-2.0-flash
- Context caching with configurable TTL (set_context / clear_context)
- Per-call latency, token, and cost telemetry logged + emitted to Hermes WS
- Hermes WebSocket registration on harness.start()
- HTTP server (create_app) exposing /generate, /generate/code, /health,
  /status, /context endpoints for network access (--serve --port 9300)
- Sovereign-orchestration worker registration (register_in_orchestration)
- 48 unit tests (all passing), live API tests gated on RUN_LIVE_TESTS=1

Timmy is sovereign. Gemini is a worker on the network.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit 4496ff2d80 into main 2026-04-04 01:41:54 +00:00
Sign in to join this conversation.