Skip to content

feat(google): support Gemini Decision models - #197501

Merged
obviyus merged 10 commits into
mainfrom
feat/google-gemini-decisions
Nov 12, 2026
Merged

obviyus merged 10 commits into
mainfrom
feat/google-gemini-decisions

Conversation

@obviyus

@obviyus obviyus commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Google launched the Gemini Decisions API (gemini-decision-1), and OpenClaw had no way to select it as a Decision model.

User Impact

Operators can set agents.defaults.decisionModel: "google/gemini-decision-1" (or pick it in the Decision picker) with an existing Gemini API key. decision_evaluate, plugin api.runtime.decisions.evaluate and automatic Decision assistance then use Gemini Decision for Boolean, Choice and Score questions over text, JSON or one inline PNG/JPEG/WebP image. Usage is priced at Google's published $0.10 per million input tokens.

This also fixes typed-only Decision models (from any provider) appearing as selectable chat models in models.list after successful live discovery of their provider.

Why This Change Was Made

  • The bundled google plugin registers a V2 Decision provider for POST /v1beta/decisions and declares gemini-decision-1 as a typed-only (chat: false) catalog row. The System One response decoder is reused; Gemini-specific mappings cover true_description/false_description criteria, total_*_tokens usage, and the score legend check.
  • Gemini rejects empty instructions, while OpenClaw makes them optional when criteria define the judgment. Choice/Score questions without instructions ask which option/level best fits the input.
  • Successful live discovery replaced every captured row for its provider, including manifest-only typed rows it never lists. The configured decisionModel then reappeared as a synthetic chat row. Typed-only rows are now retained across acquisition.

Evidence

  • Live Gemini API (real key):
    • src/decisions/registered.live.test.ts (the existing OpenAI registered live test, now parameterized over OpenAI and Google) passes for Google: mixed Boolean/Choice/Score over text plus PNG, JPEG and WebP images through the registered plugin and decision_evaluate. Output tokens are 0 and routing/incident answers are correct.
    • Wire probes matched the adapter: response shape, legend, confidence, and 400 invalid_request errors for bad keys, empty instructions, one-option choices and empty input.
  • Built-CLI end to end against the live API (isolated state, tools.profile: minimal + decision_evaluate):
    • openclaw agent exec with a Gemini chat model invoked decision_evaluate: incident 0.99, route technical, urgency 1.67.
    • Before the instructions fix, the same agent's call shape (choice/score without instructions) failed upstream, which motivated that change.
    • A Gateway-backed openclaw agent turn triaged three tickets with correct teams and cancel probabilities.
  • models.list on a throwaway Gateway:
    • Before the catalog fix: 19 chat models, including gemini-decision-1. Removing decisionModel dropped it to 18.
    • After the fix: 18 chat models, with gemini-decision-1 only under decisionModels, and Google discovery ready.
    • The new regression test fails without the fix and passes with it.
  • Focused suites pass: Google plugin, decision inference integration, prepared-model-runtime, and the models-list gateway integration files. Typecheck passes for core, core tests and extension tests.

Simplification pass (pr-simplify):

  • Removed: the single-use transport closure and execution type, a parallel Decision model-ID set (the provider now gates on the declared gemini-decisions protocol), a duplicate 222-line Google live test, a duplicate plugin-level live test, the V1-bridge assertion, and unit cases that only re-proved shared result validation. The reflected-credential case now actually reaches the credential guard.
  • Still protected: wire encoding, legend and zero-output checks, transport failure mapping, admission and cancellation, plugin registration with env auth and pricing, the typed-only catalog regression, and live text and image flows.
  • Delta against the merge base: production code went from +447 to +394 lines. Total went from +1224/-12 to +1156/-232; this includes the live-test consolidation, which removes the OpenAI-only copy.

Known limits:

  • Audio, video, PDF and remote-URL evidence are not exposed; they need a Decision input contract change.
  • Google's docs URL is not public yet, so the docs do not link it.

obviyus and others added 5 commits November 11, 2026 21:08
Register a V2 Decision provider in the bundled google plugin for the
Gemini Decisions API (POST /v1beta/decisions) and declare the typed-only
gemini-decision-1 model. Boolean questions map to native noul with
true/false descriptions; choice/score keep labels and rubric indices.
Text, JSON and inline PNG/JPEG/WebP evidence are supported.

Co-authored-by: obviyus <[email protected]>
Successful live discovery replaced every captured row for its provider,
including typed-only manifest rows that discovery never lists. The
Decision model then reached models.list through the configured-ref path
as a synthetic chat row. Retain inference.chat=false rows across
acquisition so they stay in the decision catalog only.

Co-authored-by: obviyus <[email protected]>
… live flow

Gemini requires non-empty instructions while OpenClaw makes them optional
for choice/score rubrics. Ask the rubric itself when they are omitted.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: google size: XL labels Nov 12, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Nov 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds Gemini Decision evaluations and preserves typed-only model metadata after live chat-model discovery.

Example: Select google/gemini-decision-1 and evaluate a checkout-outage ticket.

  • Before: Google has no registered Decision provider.
  • After: The reported CLI run returns incident probability 0.99, route technical, and urgency 1.67.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused integration with reported product-path proof and no actionable finding; exact-head CI is still pending.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied evidence reports built-CLI agent execution against live Gemini with concrete typed answers, Gateway-backed ticket evaluation, and models.list before/after results showing the Decision row excluded from chat inventory; the inspected live suite also covers registered text and inline image flows.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators with Gemini API credentials cannot select Gemini Decision for typed evaluations.
Reason: The collaborator-authored direction adds an opt-in provider through an established extension contract and includes the catalog correction needed to keep that provider out of chat selection.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR adds useful Gemini Decision support absent from current main, with no actionable defect found; the earlier conflict is resolved and exact-head CI remains pending.

Priority: P2
Reviewed head: 91e07efa87cf7ba8e521b0ec7c2ece884c63ee39

Before merge

None.

Findings

None.

Agent review details

How this fits together

The existing Decision runtime selects the model and prepares credentials; the Google plugin translates typed questions and evidence into guarded Gemini HTTPS requests and returns validated answers and usage.

flowchart LR
  A[Decision tool or plugin caller] --> B[Decision runtime]
  B --> C[Prepared model and credentials]
  C --> D[Google Decision adapter]
  D --> E[Guarded Gemini HTTPS endpoint]
  E --> F[Shared result validation]
  F --> A
Loading

Technical review

Best possible solution:

Land the plugin-owned integration and shared typed-row retention fix once the normal exact-head checks pass.

Do we have a high-confidence way to reproduce the issue?

This is principally a feature addition; source inspection confirms current main lacks Google's Decision registration, and the body records a before/after reproduction of the associated catalog leak.

Is this the best way to solve the issue?

The implementation uses the existing Decision provider contract, Google transport policy, shared decoder, and catalog projection owner; the retained modules serve distinct responsibilities without a competing execution path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a14127f6814e.

Provenance checked

  • Prepared catalog acquisition changes intended behavior with a stated reason (28c2686: Acquired providers replace captured inventory while unacquired providers retain captured rows.)
  • Google HTTP configuration keeps the original intent (ca171d5: Keep Google's shared HTTP policy in its narrow owner while preserving request behavior.)
  • Google static provider catalog keeps the original intent (132da0a: Declare bundled Google models in manifest metadata so discovery and Doctor recognize them.)
  • Registered Decision live coverage keeps the original intent (621f574: Exercise registered Decision dispatch with prepared credentials and inline image evidence.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 1bb76a2 adds src/agents/prepared-model-runtime.catalog-projection.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1bb76a2e1894; files: src/agents/prepared-model-runtime.catalog-projection.ts)
  • Peter Steinberger: Raw commit 28c2686 adds src/agents/prepared-model-runtime.catalog-projection.ts:33 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 28c26865b241; files: src/agents/prepared-model-runtime.catalog-projection.ts)

PR surface

Source +389, Tests +502, Docs +28, Other +5. Total +924 across 18 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 8 394 5 +389
Tests 6 728 226 +502
Docs 3 29 1 +28
Config 0 0 0 0
Generated 0 0 0 0
Other 1 5 0 +5
Total 18 1156 232 +924

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: An opt-in provider capability and bounded catalog correction provide useful functionality without an urgent existing-user outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-12T04:01:27.357Z sha bdc8b13 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-12T04:38:48.160Z sha 1f7ea1e :: needs changes before merge. :: none
  • reviewed 2026-11-12T04:44:55.940Z sha 1f7ea1e :: needs changes before merge. :: none

Reviewed November 12, 2026, 1:54 AM ET / 06:54 UTC (Revision 4).

obviyus and others added 2 commits November 12, 2026 09:32
Inline the single-use transport closure, gate on the declared decision
protocol instead of a parallel ID set, fold the Gemini live test into the
existing registered Decision live test, drop tests that only re-prove
shared validation, and tighten the docs.

Co-authored-by: obviyus <[email protected]>
@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
Revocation applies to the next request (#197557); a race test for a request
already in flight is speculative machinery the updated rules reject.

This reverts commit 1f7ea1e.

Co-authored-by: obviyus <[email protected]>
…cisions

# Conflicts:
#	docs/concepts/decision-models.md
@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@obviyus
obviyus merged commit 0182580 into main Nov 12, 2026
118 checks passed
@obviyus
obviyus deleted the feat/google-gemini-decisions branch November 12, 2026 07:01
RomneyDa added a commit that referenced this pull request Nov 12, 2026
Adapt #197501 (0182580) by Ayaan Zaidi. Keep typed-only catalog entries after discovery and register the decision adapter after its shared provider. Retain OpenAI coverage in the shared live suite.

53 focused tests pass; scoped types, lint, formatting and docs pass. Local all-extension typing remains blocked by missing Matrix SDK, and no live Google key is injected. Independent local review omitted by owner direction.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
* feat(google): support Gemini Decision models

Register a V2 Decision provider in the bundled google plugin for the
Gemini Decisions API (POST /v1beta/decisions) and declare the typed-only
gemini-decision-1 model. Boolean questions map to native noul with
true/false descriptions; choice/score keep labels and rubric indices.
Text, JSON and inline PNG/JPEG/WebP evidence are supported.

Co-authored-by: obviyus <[email protected]>

* feat(google): price Gemini Decision input tokens

Co-authored-by: obviyus <[email protected]>

* test(google): add Gemini Decision live coverage

Co-authored-by: obviyus <[email protected]>

* fix(models): keep typed-only rows after live chat discovery

Successful live discovery replaced every captured row for its provider,
including typed-only manifest rows that discovery never lists. The
Decision model then reached models.list through the configured-ref path
as a synthetic chat row. Retain inference.chat=false rows across
acquisition so they stay in the decision catalog only.

Co-authored-by: obviyus <[email protected]>

* feat(google): default Gemini Decision instructions and add registered live flow

Gemini requires non-empty instructions while OpenClaw makes them optional
for choice/score rubrics. Ask the rubric itself when they are omitted.

Co-authored-by: obviyus <[email protected]>

* test(google): fold Gemini Decision live coverage into the registered flow

Co-authored-by: obviyus <[email protected]>

* refactor(google): simplify Gemini Decision provider

Inline the single-use transport closure, gate on the declared decision
protocol instead of a parallel ID set, fold the Gemini live test into the
existing registered Decision live test, drop tests that only re-prove
shared validation, and tighten the docs.

Co-authored-by: obviyus <[email protected]>

* test(google): prove revoked authority stops Gemini Decision dispatch

Co-authored-by: obviyus <[email protected]>

* test(google): drop in-flight revocation race test

Revocation applies to the next request (openclaw#197557); a race test for a request
already in flight is speculative machinery the updated rules reject.

This reverts commit 1f7ea1e.

Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: obviyus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: google P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant