Skip to content

v1.92.11.0 feat: design mockups with Gemini when there's no OpenAI key (#990) - #3768

Merged
capy-ai[bot] merged 9 commits into
mainfrom
capy/gsta223-design-gemini
Nov 1, 2026
Merged

capy-ai[bot] merged 9 commits into
mainfrom
capy/gsta223-design-gemini

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3768,
  "head": "a15f42a4871b5a8c2967c27f83b77c79347746c0",
  "version": "1.91.379.0",
  "base": "main",
  "gate": {
    "design": {
      "pass": 222,
      "fail": 0,
      "skip": 0
    },
    "egress": {
      "pass": 295,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "5ae08b75bf27be463ac7db689405cb9043eb2d19",
  "product_patch_id": "697ef6861584a44640d70c01a7385be5ef6c0528",
  "gstack_version": "1.91.379.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 1071,
    "rules": "150435b0a543019a",
    "base": "4eff47c5cf8464c1537194817ffa8984139d3ca0",
    "registry": "4eff47c5cf8464c1537194817ffa8984139d3ca0",
    "gate_scan": {
      "tagged": 0,
      "head": "a15f42a4871b5a8c2967c27f83b77c79347746c0"
    },
    "reasons": [
      "gate-class",
      "runtime=1071>50"
    ]
  },
  "pregate": "requires-remote cleared @5ae08b75bf27 (1 checks, current for a15f42a4871b)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41252521929",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41252521904",
    "pregate.json/remote_gate: remote-gate tree=5ae08b75bf27 tests=18631"
  ],
  "issues": {
    "fixes": [
      990
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md and the changed skill templates (design-html, plan-design-review)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 2,
    "est_input_tokens": 89609,
    "dispatches": {
      "specialist-batched": 1,
      "red-team": 1
    }
  },
  "review_targeted": {
    "classes": [
      "money",
      "auth",
      "secret"
    ],
    "rules": "baeb8f7ef7da92d0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "697ef6861584a44640d70c01a7385be5ef6c0528",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

What changed

Before: a Gemini key alone fails with 'No OpenAI API key found' and the design skills draw wireframes. After: the design binary uses Gemini and saves the mockup (Google's answer stubbed locally for this capture, no network).

Before: a Gemini key alone fails with 'No OpenAI API key found' and the design skills draw wireframes. After: the design binary uses Gemini and saves the mockup (Google's answer stubbed locally for this capture, no network).

Before/after as text: Before: a Gemini key alone fails with 'No OpenAI API key found' and the design skills draw wireframes. After: the design binary uses Gemini and saves the mockup (Google's answer stubbed locally for this capture, no network; session ids shortened).
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 $ GEMINI_API_KEY=AIza… $D generate --brief "Pricing page for a todo app" --output mockup.png
+Using Gemini key from GEMINI_API_KEY environment variable.
+Note: on Google's free tier, Gemini API prompts and images may be used to improve Google's products (https://ai.google.dev/gemini-api/terms); a key with billing enabled is not.
+Generated (0.0s, 0KB) → ~/mockup.png
-No OpenAI API key found.
-
-Run: $D setup
-  or save to ~/.gstack/openai.json: { "api_key": "sk-..." }
-  or set OPENAI_API_KEY environment variable
-
-Get a key at: https://platform.openai.com/api-keys
 {
+  "outputPath": "~/mockup.png",
+  "sessionFile": "~/design-session-<pid>-<time>.json",
+  "responseId": "gemini-<time>",
+  "attempts": [
-  "outputPath": null,
-  "sessionFile": null,
-  "responseId": null,
-  "attempts": [],
-  "requested": 1,
-  "saved": [],
-  "selected": null,
-  "failures": [
     {
+      "path": "~/mockup.png",
+      "sessionFile": "~/design-session-<pid>-<time>.json",
+      "responseId": "gemini-<time>"
-      "file": "~/mockup.png",
-      "reason": "No OpenAI API key found.\n\nRun: $D setup\n  or save to ~/.gstack/openai.json: { \"api_key\": \"sk-...\" }\n  or set OPENAI_API_KEY environment variable\n\nGet a key at: https://platform.openai.com/api-keys"
     }
   ],
+  "requested": 1,
+  "saved": [
+    "~/mockup.png"
+  ],
+  "selected": "~/mockup.png",
+  "failures": [],
   "recovered": []
 }
+exit=0
+~/mockup.png
+saved mockup.png
-exit=2
-no image saved
 

Why

Issue #990: "non-OpenAI image providers in design". Without an OpenAI key, or with an OpenAI organization that hasn't passed ID verification (now required for every OpenAI image model), /design-shotgun, /design-review, /plan-design-review and /design-html fall back to HTML wireframes. Gemini keys are free to create and need no ID check, so the design binary now uses Gemini when no OpenAI key is set, and anyone with an OpenAI key sees no change.

Blast radius

Every design command (generate, variants, iterate, evolve, check, diff, extract, prompt, setup) now goes through one provider seam in design/src/provider.ts. OpenAI stays first whenever its key resolves (config file, then env), and OpenAI requests are still built by the same body builders as on main, so OpenAI users' requests don't change: design/test/ (222 tests, including the existing OpenAI suites) passes unchanged except one expected-message string (script ran).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Approve the plan "GSTA-223 plan: design images with Gemini when there is no OpenAI key (B1, #990)" (autoplan run autoplan-20261031203710, 3 decisions) “Do it a through e” (Garry, relayed by agent:jam_01M69TK4J1ZKECFK5S9PR1SH4G) approved the reviewed plan (sha256 196160fd7c06), every recommendation taken none

Source: gstack-approvals record for capy/gsta223-design-gemini (display only; not an approval citation).

Summary

Before this change, GEMINI_API_KEY alone gave "No OpenAI API key found" (failing-first test on main 2d1b55d: expected exit 0, got 2). Now:

  • Provider pick is one fixed order: GSTACK_DESIGN_PROVIDER=openai|gemini when set, else an OpenAI key (~/.gstack/openai.json, then OPENAI_API_KEY), else a Gemini key (~/.gstack/gemini.json, then GEMINI_API_KEY). A failure on one provider is never retried on the other; the OpenAI verification error names the switch.
  • Gemini covers every call. Images use native models/<m>:generateContent (responseModalities: ["IMAGE"], aspect ratio from the size); screenshot reading uses Google's OpenAI-compatible Chat Completions endpoint. Defaults: gemini-nano-banana-2.1 (image), gemini-3.8-flash (vision); overrides must be gemini-… names. iterate on Gemini edits the last image and regenerates only on a 400.
  • Errors say what to do: new anchors in docs/troubleshooting.md for no key, an invalid provider, a forced provider with no key, a rejected Gemini key and an exhausted daily quota. variants honors Gemini's RetryInfo and stops retrying a daily quota.
  • $D setup --provider openai|gemini --key-stdin stores a key with no terminal; when OpenAI would still win later runs, setup prints the export that switches.
  • Egress: Google calls are receipted as design-gemini (fail-open, like design-openai).

Not checked against the live API. No Gemini key exists on the crew machines (decision E1). Request and response shapes follow Google's docs (fetched 2026-10-31) and the fixtures in design/test/gemini-provider.test.ts. GEMINI_API_KEY=... bun run design/scripts/live-gemini-check.ts (about $0.04) checks the defaults once a key exists; that and a JPEG answer (refused today) are filed in TODOS.md.

Security read. New network call: generativelanguage.googleapis.com (needed: it is the provider). New secret: the Gemini key, read from ~/.gstack/gemini.json (written 0600 from creation) or GEMINI_API_KEY; it travels only in the x-goog-api-key header (Authorization Bearer on the OpenAI-compatible endpoint), never in a URL or log line, and OPENAI_BASE_URL never applies to Gemini. On Google's free tier, prompts and images may be used to improve Google's products; $D says so once per run. iterate uploads the session's last image only when it is an absolute-path PNG under 15 MB. No dependency, workflow, setup or install change. Ideas credited from #990, #998, #946, #881 and #777; no outside code was checked out, run or carried over.

Test Coverage

Coverage: deterministic (each of 20 changed runtime files has a changed test naming it). New: design/test/gemini-provider.test.ts (fake Gemini, no network).
Tests ran: design 222
Tests ran: egress 295
Remote free tier (Ubicloud, tree 5ae08b75bf27): 18631 tests, 0 failed.

Pre-Landing Review

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=4 scope=frozen fix_checks=2 dispatches=3 est_input_tokens=89609

Pass 1 (specialists, Red Team, QA): 3 informational findings, all fixed: setup --key-stdin dropped a piped key when another key resolved; setup --provider gemini claimed success while later runs still picked OpenAI (now prints the export); Gemini iterate fallbacks had no tests. Step 11 (native adversarial, outside voice on gpt-6.1-sol, targeted money/auth/secret): three findings labeled critical, all fixed before release: a thinking Gemini answer could save an interim draft (now the last non-thought image part); iterate could upload any file a session JSON named (now absolute-path PNG under 15 MB only); relative session paths reopened against another working directory (sessions now store absolute paths). Two fix-checks read the fixed hunks; the targeted reader at the final tree found nothing.
Gate edits: none detected (5 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed (openai/gpt-6.1-sol), finding fixed.

Review notes

  • Auto-picking Gemini when only GEMINI_API_KEY is set is approved plan decision 1; the once-per-run data notice is the disclosure.
  • $D check still reports a failed vision call as pass: true, status: "skipped" on both providers, as on main; filed in TODOS.md as its own decision.

Exploratory QA

Smoke (2 of 12 probes, both pass): the changed tests exit 0; $D generate with no key exits 2 with "No image API key found (OpenAI or Gemini)", the Fix line and saved: []. No live-key success path (no key).

Design Review

No frontend files changed — design review skipped.

Eval Results

Two skill templates changed by one sentence each (plan-design-review relays the last Fix: line; design-html names the provider's vision model); parity and size guards pass at their pins. Paid evals run in CI on this PR (evals.yml, PR profile).

Plan Completion

Plan: plans/GSTA-223.md in the GStack Minder drive (autoplan run autoplan-20261031203710, approved). All five build items shipped; the live render stays conditional on a key (B1/E1).

Issues

Fixes #990

TODOS

No TODO items completed in this PR. Added "Gemini design provider follow-ups" (live check, $D check semantics) and narrowed the provider-pluralism theme now that Gemini shipped.

Documentation

Status: updated. One factual edit, no blockers.

Scope: base 2d1b55d to head 20a04e1 (27 files: Gemini design provider). No staged, unstaged or untracked content. Audited the changed docs and templates plus the README, ARCHITECTURE, CONTRIBUTING, CLAUDE and nested docs that mention the design binary or its API keys.

Documentation health:
docs/CONTRIBUTOR_REFERENCE.md [Updated] (egress fail-open list: 'design OpenAI calls' became 'design OpenAI and Gemini calls')
docs/hosts.md [Current] (Gemini provider section already added)
docs/troubleshooting.md [Current] (new Gemini error anchors already added)
README.md [Current]
ARCHITECTURE.md [Current]
CONTRIBUTING.md [Current]
CLAUDE.md [Current]
docs/PROJECT_STRUCTURE.md [Current]
design-html, plan-design-review and design-shotgun templates [Current]
CHANGELOG.md [Not edited: ship-owned boundary; entry is the changelog.d fragment]
TODOS.md [Not edited: ship-owned boundary; Gemini follow-ups already filed]

Documentation coverage:
Gemini design provider: reference yes (docs/hosts.md), how-to yes (docs/troubleshooting.md), tutorial no, explanation no.

Diagram drift: none found.

Test plan

  • bun test design/test/: 222 pass, 0 fail
  • bun test test/egress-receipt-wiring.test.ts test/troubleshooting-anchors.test.ts: 295 pass
  • Remote pregate (whole free tier, Ubicloud): 18631 tests, 0 failed on tree 5ae08b75bf27
  • bun run typecheck clean; bun run typecheck:test 814 known, none new; parity and SKILL.md size guards pass

garrytan and others added 9 commits October 31, 2026 21:34
… OpenAI key (#990)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…et-shaped assignments

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…rovider export; Gemini iterate fallback tests)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ds only absolute-path PNGs under 15 MB; sessions store absolute output paths

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Evals: ✅ PASS

[test:paid] VERDICT GREEN — lane gate/pr, attempt 1
  rule 1/1 · behavior 0/0 · judge 1/1 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 0
  wall 0m27s · cost $0.14

2 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $.14 rule/judge cost | reconcile exit: 0

Profile: pr / mode pr; selected behaviors: 1, judges: 1. Deferred to scheduled/release coverage: 25 behaviors and 2 changed prompt files. Deferred checks did not run and receive no PR-pass credit.

Rule and judge shards
Shard Automated result Manual/unscored Executed Reused Status Cost
llm-judge/skill-llm-eval 1/1 0 1 0 ✅ $0.06
e2e-design/skill-e2e-design--plan-design-review-no-ui-scope 1/1 0 1 0 ✅ $0.08
Fail-closed reconciliation
[test:paid] report: 1/1 slices, 2 planned shards, tier=gate, attempt 1
[test:paid] coverage: profile=pr mode=pr; selected E2E=1, judges=1
[test:paid] deferred: 25 broad behaviors, 2 changed prompts without quick live coverage; these are not PR passes
  slice 1  passed             23s  test/skill-llm-eval.test.ts
  slice 1  passed             13s  test/skill-e2e-design.test.ts#plan-design-review-no-ui-scope
[test:paid] collector final outcomes: 2 executed, 0 reused; 2 passed, 0 failed, 0 manual accepted (unscored; no score-cache credit) (2 attempt records from 2 collectors; every record counts)
[test:paid] deselected testcases, zero credit (34):
[test:paid]     23  outside the run's case selection
[test:paid]     11  sibling case of a case shard (its own shard runs it)
[test:paid] VERDICT GREEN — lane gate/pr, attempt 1
  rule 1/1 · behavior 0/0 · judge 1/1 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 0
  wall 0m27s · cost $0.14
[test:paid] exercised-path map (shadow, non-blocking): 0 MAP_GAP line(s) over 1 executed case(s) with recorded commands
[test:paid] report: every planned shard accounted and passed

Sliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry.

Dispatched narrow screen (gstack-ship-queue ready --screen) of merge commit 81397457ca6235f9823f8690540c4a053290182b.

@github-actions github-actions Bot changed the title feat: design mockups with Gemini when there's no OpenAI key (#990) v1.92.11.0 feat: design mockups with Gemini when there's no OpenAI key (#990) Nov 1, 2026
@capy-ai
capy-ai Bot merged commit 71acd83 into main Nov 1, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support non-OpenAI image providers in design skill (Gemini as first alt)

1 participant