Skip to content

fix(openclaw): classify Gemini 3 managed route - #8487

Open
VinayBhagavath wants to merge 14 commits into
NVIDIA:mainfrom
VinayBhagavath:codex/fix-gemini3-openclaw-tools-8474
Open

fix(openclaw): classify Gemini 3 managed route#8487
VinayBhagavath wants to merge 14 commits into
NVIDIA:mainfrom
VinayBhagavath:codex/fix-gemini3-openclaw-tools-8474

Conversation

@VinayBhagavath

@VinayBhagavath VinayBhagavath commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

NemoClaw now loads an OpenClaw compatibility plugin for Gemini 3.x models on the managed inference.local Chat Completions route. The plugin marks that route as Google Generative AI so OpenClaw applies its Gemini tool-call thought-signature handling.

Related Issue

Fixes #8474

Changes

  • Added an OpenClaw model-specific setup manifest for Gemini 3.x managed inference.local routes.
  • Added a metadata-only OpenClaw compatibility plugin that declares providerEndpoints[].endpointClass as google-generative-ai for https://inference.local/v1.
  • Added focused generator tests for bare and namespaced Gemini 3 model IDs, plus non-matching model, provider, API, and base URL cases.
  • Added a networkless OpenClaw 2026.7.1 runtime regression that loads the generated production plugin, verifies managed-route classification, and directly replays a Gemini tool call and tool result through the thought-signature request path.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: The change is automatic compatibility for an existing managed route. It adds no command, flag, credential, configuration input, or user workflow.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Reviewed the OpenClaw managed inference configuration boundary. The change adds no credential flow, auth path, policy rule, network egress rule, or dependency. The runtime regression uses the immutable NemoClaw sandbox base image with networking disabled, all capabilities dropped, a read-only filesystem, and no privileged execution.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: Existing docs already describe Google Gemini 3 models, the managed inference.local Chat Completions route, and agent-specific compatibility setup. This change restores the documented Gemini 3 tool-call path. It adds no command, credential, configuration input, or user workflow; no documentation files changed.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: Focused generator and networkless runtime tests passed on the completed change: 2 files and 4 tests, including direct tool-call result replay through the thought-signature request path. Scoped hooks and TypeScript checks passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Vinay Bhagavath bhagavathvinay@gmail.com

Summary by CodeRabbit

  • New Features

    • Added managed Gemini 3 inference support through the local inference route.
    • Added compatibility handling for Gemini tool-call thought signatures.
    • Added automatic loading of the Gemini compatibility integration for supported configurations.
  • Tests

    • Added coverage for supported and unsupported Gemini routing scenarios.
    • Added runtime validation to confirm the integration loads and classifies managed inference correctly.

@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Gemini 3 managed-inference configuration and an OpenClaw compatibility plugin. Functional tests verify route matching and exclusions. A Docker-based runtime test verifies plugin loading and Google Generative AI classification.

Changes

Gemini 3 managed inference

Layer / File(s) Summary
Compatibility plugin contract
nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/index.ts, nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/openclaw.plugin.json
Defines plugin metadata, managed endpoint classification, an empty registration hook, and a restrictive configuration schema.
Managed route wiring and validation
nemoclaw-blueprint/model-specific-setup/openclaw/gemini-3-managed-inference.json, test/generate-openclaw-config-gemini-compat.test.ts
Loads the compatibility plugin for matching Gemini 3 managed routes and tests supported and excluded configurations.
Runtime compatibility validation
test/openclaw-gemini-inference-compat-runtime.test.ts
Builds an offline OpenClaw runtime, loads the generated plugin, and verifies Google Generative AI routing classification in a hardened container.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: senthilr-nv

Sequence Diagram(s)

sequenceDiagram
  participant ConfigGenerator
  participant OpenClaw
  participant GeminiCompatPlugin
  participant RoutingProbe
  ConfigGenerator->>OpenClaw: Generate Gemini 3 managed-route configuration
  OpenClaw->>GeminiCompatPlugin: Load compatibility plugin
  GeminiCompatPlugin-->>OpenClaw: Classify inference.local as google-generative-ai
  RoutingProbe->>OpenClaw: Inspect plugin and provider routing
  OpenClaw-->>RoutingProbe: Return loaded plugin and routing classification
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes classify the managed Gemini 3 route as Google Generative AI and add focused tests, directly addressing issue #8474.
Out of Scope Changes check ✅ Passed The manifests, plugin, and tests directly support Gemini 3 managed-route compatibility and contain no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: classifying the Gemini 3 managed OpenClaw route.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/index.js (1)

4-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Record an accepted integration decision before release.

PR 8487 documents the security boundary and targeted validation, but it has no assignee, review, or approval. Define the owner, lifecycle, and maintainer acceptance of the security boundary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/index.js` around
lines 4 - 10, Update the plugin metadata around the module.exports definition to
record the accepted integration decision before release, including a named
owner, lifecycle or maintenance responsibility, and maintainer review/approval
of the security boundary described by the plugin. Keep the existing
compatibility behavior and registration unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/index.js`:
- Around line 4-10: Update the plugin metadata around the module.exports
definition to record the accepted integration decision before release, including
a named owner, lifecycle or maintenance responsibility, and maintainer
review/approval of the security boundary described by the plugin. Keep the
existing compatibility behavior and registration unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7ef720b2-c2e3-41e2-a687-14e9c3c99b21

📥 Commits

Reviewing files that changed from the base of the PR and between affe641 and 7c2a2ba.

📒 Files selected for processing (4)
  • nemoclaw-blueprint/model-specific-setup/openclaw/gemini-3-managed-inference.json
  • nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/index.js
  • nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/openclaw.plugin.json
  • test/generate-openclaw-config-gemini-compat.test.ts

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Maintainer follow-up for revision 7c2a2bacf:

Review feedback disposition

I verified the CodeRabbit maintainability nitpick and am not changing the runtime plugin metadata. openclaw.plugin.json has a defined schema for runtime behavior, while named ownership, lifecycle decisions, and approval state are repository-process concerns. The model-specific setup registry is the repository ownership boundary, reviewer routing is repository-owned, and this PR remains subject to the normal required approval gate. Encoding a person name or a transient approval state in executable plugin metadata would not improve the compatibility behavior.

Security review: PASS

Category Result Reason
Secrets and credentials PASS No credentials or credential-shaped values are added.
Input validation and sanitization PASS Activation is constrained by model prefix, provider, API, and the managed inference.local base URL; negative cases cover each route mismatch.
Authentication and authorization PASS No auth boundary or permission path is changed.
Dependencies PASS No dependency is added or changed.
Error handling and logging PASS No new logging or error surface is introduced.
Cryptography and data protection PASS No cryptographic or sensitive-data handling is introduced.
Configuration and secure defaults PASS The plugin is metadata-only, has an empty restrictive config schema, and loads only for the matched managed route.
Security testing PASS Focused tests cover supported models plus non-Gemini, wrong-provider, wrong-API, and public-endpoint exclusions.
Holistic posture PASS This only classifies the existing managed route for OpenClaw pinned provider-attribution logic; it does not widen network policy or expose a new endpoint.

Files reviewed: the Gemini setup manifest, plugin entry point, plugin manifest, and focused integration test.

Documentation review: PASS — no documentation change needed

This is automatic internal compatibility metadata for an existing managed route. It adds no command, configuration step, or user workflow. The existing model-specific setup registry documentation remains accurate.

Validation

  • Focused config-generation tests: 131 passed
  • Checked-in schema tests: 106 passed
  • Config validation: all 51 files passed
  • Repository PR gate: passed
  • Diff, secret, and conflict checks: passed

GitHub-hosted workflows are still queued during the current Actions service disruption. I have not rerun queued jobs; merge remains blocked until the required checks finish and the required approval is present.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Maintainer security review for the current branch revision: PASS — no findings.

Nine-category review:

  1. Secrets and credentials: no credential values, stores, or forwarding paths change.
  2. Input validation: activation is limited by the manifest to Gemini 3 model identifiers on the managed inference provider, Chat Completions API, and https://inference.local/v1; the plugin accepts no configuration properties.
  3. Authentication and authorization: no auth or authorization behavior changes.
  4. Dependencies: no package, lockfile, image, or registry dependency changes.
  5. Error handling and logging: no new logging or error surface is introduced.
  6. Cryptography and data protection: not applicable; no cryptographic or data-storage operation changes.
  7. Configuration: the change only classifies the managed route for an existing OpenClaw compatibility path; it adds no egress, policy, port, capability, or secret exposure.
  8. Security testing: positive coverage proves the intended bare and namespaced Gemini 3 matches; negative coverage proves other models, providers, APIs, and base URLs do not activate the plugin.
  9. Holistic posture: this enables the existing OpenClaw thought-signature handling only at the bounded managed-route boundary and does not add a payload rewrite or bypass.

Validation: 131 generator tests passed, 10 focused schema tests passed, CLI type checking passed, and the source-shape guard passed. The broader configuration validator could not be rerun locally because the sandbox denied the TypeScript runner IPC socket; its protected hosted result remains required before merge.

Review disposition: the CodeRabbit owner/lifecycle request is a governance decision, not runtime plugin metadata. The existing plugin contract does not encode repository ownership or approval fields, so adding ad hoc fields to module.exports would not establish enforceable ownership. Maintainer acceptance of the supported Gemini 3 integration surface and its lifecycle is still required and is deferred for human approval. No code change is appropriate for that request.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Failed after a partial review · low confidence · 0 blockers · 0 warnings · 0 suggestions

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

3 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — managed inference at nemoclaw-blueprint/model-specific-setup/openclaw/gemini-3-managed-inference.json:5: Keep the established controlled term.
  • justified — Google Generative AI at nemoclaw-blueprint/openclaw-plugins/gemini-inference-compat/openclaw.plugin.json:9: Keep this classifier name where it identifies the required OpenClaw endpoint class.
  • justified — thought-signature at nemoclaw-blueprint/model-specific-setup/openclaw/gemini-3-managed-inference.json:5: Keep the term with the Gemini tool-call context that defines its purpose.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

Recommended E2E: managed-image-multiarch-startup, inference-routing, network-policy

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Addressed PRA-1 on the current branch revision (d67080228).

  • Added test/openclaw-gemini-inference-compat-runtime.test.ts.
  • The regression generates the Gemini 3 managed-route config, copies the production compatibility plugin into the immutable OpenClaw 2026.7.1 runtime image, rebuilds the trusted plugin registry, loads the plugin, and verifies https://inference.local/v1 resolves to google-generative-ai with native documented routing.
  • The container runs without networking, with a read-only filesystem, all Linux capabilities dropped, and no-new-privileges enabled.
  • Focused generator/runtime tests pass (4 tests), npm run typecheck:cli passes, and pre-commit, commit-message, and pre-push checks pass.
  • Documentation writer review: no docs change is needed because this is automatic compatibility for an existing managed route with no new user action, configuration, credential, API, or workflow.
  • Security review: no findings. No auth, credential, policy, egress, dependency, or privileged-execution boundary was added.

The separate CodeRabbit metadata suggestion remains intentionally declined: ownership, lifecycle responsibility, and maintainer approval belong in repository governance and reviewer routing, not executable runtime metadata.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/openclaw-gemini-inference-compat-runtime.test.ts`:
- Around line 86-87: Update the `suite` selection to skip when
`dockerProbe.status` is not 0, removing the `process.platform === "linux"`
override. Keep the suite enabled only when `docker info` succeeds so `beforeAll`
does not run Docker-dependent setup without a usable daemon.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d2e4fba3-9ccc-4634-920b-a29951902a54

📥 Commits

Reviewing files that changed from the base of the PR and between 7c2a2ba and d670802.

📒 Files selected for processing (1)
  • test/openclaw-gemini-inference-compat-runtime.test.ts

Comment thread test/openclaw-gemini-inference-compat-runtime.test.ts Outdated
@github-actions github-actions Bot added v0.0.105 Release target and removed v0.0.104 labels Aug 7, 2026
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

CI follow-up: the growth guard rejected two conditional cleanup branches in the Gemini runtime test. I replaced them with registered cleanup callbacks, preserving Docker-image and temporary-directory teardown without adding conditional branches.

The focused runtime regression, conditional scanner, commit hooks, CLI build/typecheck, DCO, signature verification, and documentation-writer review all pass. Fresh CI and automated review are running. This PR still needs repository-routed human approval before it can merge.

cv
cv previously requested changes Aug 7, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a behavior test for the defect before approval. The current runtime test proves plugin loading and endpoint classification, but it does not drive a Gemini 3 tool-call result round through OpenClaw's thought-signature path. A regression could preserve the routing summary while still sending an invalid follow-up request. The branch is also behind the current main commit; refresh it and rerun the required checks after adding the test.

cv and others added 3 commits August 7, 2026 01:37
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Addressed the requested behavior coverage and branch refresh on the current revision.

  • The networkless runtime regression now drives a Gemini 3 assistant tool call and matching tool result through OpenClaw’s completions request builder. It verifies that the assistant tool call receives the compatibility thought signature and that the tool-result ID and content are preserved in the follow-up request.
  • The contributor’s concurrent main refresh was preserved without overwriting their work, and the branch was then refreshed through the latest non-overlapping main changes.
  • Focused generator and runtime validation passes: 2 files, 4 tests. TypeScript and normal push checks also pass.
  • Final documentation review reports no docs change needed; the security boundary is unchanged.

Fresh repository checks are now running on the updated branch.

@cv
cv dismissed their stale review August 7, 2026 10:31

The runtime regression now exercises the Gemini 3 tool-call and tool-result thought-signature path. The requested change is addressed.

@cv
cv enabled auto-merge (squash) August 7, 2026 10:45
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

CI disposition: the earlier shard 5 failure was a 15-second timeout in test/managed-bootstrap-trampoline.test.ts:305, a file this PR does not change. The failed shard passed on rerun for the same branch revision, and the cli-tests and final checks aggregates are now green. Classified as transient test/runner flakiness; no PR code change is warranted.

@senthilr-nv senthilr-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved commit e6b0ae3 against base 272cc64. Product scope is established by #8474; the managed-route activation boundary, security posture, focused tool-call regression, configuration validation, contributor compliance, and documentation review all pass. All five required GitHub checks are green, and no actionable automated-review finding remains.

@senthilr-nv
senthilr-nv disabled auto-merge August 7, 2026 17:23
@senthilr-nv
senthilr-nv enabled auto-merge (squash) August 7, 2026 17:23
@senthilr-nv
senthilr-nv disabled auto-merge August 7, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenClaw + Gemini 3.x via managed inference route: every tool call fails with 400 (missing thought_signature)

4 participants