Skip to content

Support Gemini Embedding 2 GA - #89117

Closed
abel-zer0 wants to merge 1 commit into
openclaw:mainfrom
abel-zer0:fix/gemini-embedding-2-ga
Closed

abel-zer0 wants to merge 1 commit into
openclaw:mainfrom
abel-zer0:fix/gemini-embedding-2-ga

Conversation

@abel-zer0

Copy link
Copy Markdown
Contributor

Summary

  • add support for the GA gemini-embedding-2 Gemini API embedding model id
  • keep gemini-embedding-2-preview configs working by normalizing them to the GA id
  • allow Gemini Embedding 2 output dimensions across the documented 128-3072 range while keeping 768/1536/3072 as recommended values
  • reuse the same model normalization for multimodal embedding capability checks

Tests

  • node scripts/run-vitest.mjs extensions/google/embedding-provider.test.ts
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added extensions: google size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 29, 2026, 6:57 PM ET / 22:57 UTC.

Summary
The PR adds GA gemini-embedding-2 support to the Google memory embedding provider, remaps the preview id to the GA id, widens dimension validation, and updates the multimodal support check.

PR surface: Source +6, Tests -1. Total +5 across 3 files.

Reproducibility: yes. for the PR defects at source level: PR head routes gemini-embedding-2 through request builders that still emit taskType, and current memory identity code shows the preview remap changes cache/index identity. I did not run a credentialed live Gemini request.

Review metrics: 2 noteworthy metrics.

  • Model alias behavior: 1 shipped id remapped. Existing preview configs would resolve to a different model/cache identity unless the PR defines an alias or reindex path.
  • Dimension validation: 3 fixed values changed to range 128-3072. The accepted user configuration surface changes and must stay aligned with docs, help text, and live provider behavior.

Stored data model
Persistent data-model change detected: unknown-data-model-change: extensions/google/embedding-provider.test.ts, unknown-data-model-change: extensions/google/embedding-provider.ts, vector/embedding metadata: extensions/google/embedding-provider.test.ts, vector/embedding metadata: extensions/google/embedding-provider.ts, vector/embedding metadata: extensions/google/memory-embedding-adapter.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Remove or replace taskType for gemini-embedding-2 across query, inline batch, and provider batch paths, with focused tests.
  • Make preview-to-GA cache/index identity behavior explicit through an alias, migration, or documented reindex path approved by maintainers.
  • [P1] Add redacted real Gemini API proof to the PR body, with API keys, IP addresses, phone numbers, private endpoints, and other private details removed.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists unit-test and whitespace-check commands but no redacted live Gemini API output, logs, terminal output, or artifact proving the changed provider path after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] GA gemini-embedding-2 calls can fail because the PR still sends taskType, while Google's current docs say that field cannot be used with the GA model.
  • [P1] Existing gemini-embedding-2-preview configs would normalize to gemini-embedding-2, which can pause vector search or force reindexing because model/cache identity changes without an explicit alias or documented upgrade decision.
  • [P1] The accepted model and dimension config surface changes while public docs and schema help still describe the preview id and old fixed dimension set.
  • [P1] The contributor has not provided redacted live Gemini API proof, so the changed real provider path is not proven beyond mocks/unit tests.

Maintainer options:

  1. Fix the GA request and upgrade contract first (recommended)
    Remove or replace taskType for gemini-embedding-2, add an explicit preview alias or documented reindex decision, update docs/help, and require live proof before merge.
  2. Accept a deliberate reindex break
    Maintainers may intentionally allow preview configs to move to a new index identity, but the PR should document that upgrade behavior and prove the fresh/reindex path.
  3. Pause until provider proof exists
    If nobody can run the real Gemini API path, keep the PR open but blocked rather than merging support proven only by mocks.

Next step before merge

  • [P1] Manual review remains because the blockers include contributor-provided live provider proof and a maintainer decision on preview-to-GA index/cache identity, not only a mechanical patch.

Security
Cleared: No concrete security or supply-chain regression was found; the diff changes provider request logic and tests without touching dependencies, CI, package metadata, permissions, or secret handling.

Review findings

  • [P1] Stop sending taskType with Gemini Embedding 2 — extensions/google/embedding-provider.ts:77
  • [P1] Make preview-to-GA remapping upgrade-safe — extensions/google/embedding-provider.ts:240-241
  • [P2] Update config guidance for GA dimensions — extensions/google/embedding-provider.ts:210
Review details

Best possible solution:

Update the Google provider, tests, docs/help, and index identity handling so GA requests match Google's contract, preview upgrades are explicit, and redacted live Gemini proof covers the real provider path before merge.

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

Yes for the PR defects at source level: PR head routes gemini-embedding-2 through request builders that still emit taskType, and current memory identity code shows the preview remap changes cache/index identity. I did not run a credentialed live Gemini request.

Is this the best way to solve the issue?

No. The Google provider is the right boundary, but this implementation is not the best fix until it handles the GA task-type contract, preview upgrade identity, docs/help alignment, and live provider proof.

Full review comments:

  • [P1] Stop sending taskType with Gemini Embedding 2 — extensions/google/embedding-provider.ts:77
    Adding gemini-embedding-2 to the Embedding 2 set makes GA requests flow through helpers that still serialize taskType for query, inline batch, and provider batch calls. Google's current docs say task_type cannot be used with gemini-embedding-2, so live GA requests can fail; omit it for GA or encode task intent in prompt text across all paths. (ai.google.dev)
    Confidence: 0.91
  • [P1] Make preview-to-GA remapping upgrade-safe — extensions/google/embedding-provider.ts:240-241
    Normalizing gemini-embedding-2-preview to gemini-embedding-2 changes client.model, and the adapter uses that value in cacheKeyData. Existing preview configs can switch memory index/cache identity without an explicit alias, migration, or documented reindex decision; preserve a deliberate compatibility identity or prove the required reindex path.
    Confidence: 0.88
  • [P2] Update config guidance for GA dimensions — extensions/google/embedding-provider.ts:210
    The code now accepts gemini-embedding-2 and any integer dimension from 128 through 3072, but the memory config reference, schema help, and multimodal note still advertise the preview id and 768/1536/3072 only. Update the user-facing guidance so the new accepted config surface is not stale.
    Confidence: 0.85

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b7b2e1f77eb4.

Label changes

Label justifications:

  • P2: This is a normal-priority provider support improvement with blocking correctness and proof issues, not an urgent active regression.
  • merge-risk: 🚨 compatibility: The PR silently remaps a shipped preview model id to a new GA id and changes accepted dimensions, which can affect existing Gemini memory-search configs and reindex behavior.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists unit-test and whitespace-check commands but no redacted live Gemini API output, logs, terminal output, or artifact proving the changed provider path after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +6, Tests -1. Total +5 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 23 17 +6
Tests 1 24 25 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 47 42 +5

What I checked:

  • Current main lacks GA model id support: Current main only includes gemini-embedding-2-preview in GEMINI_EMBEDDING_2_MODELS, so the central GA support is not already implemented. (extensions/google/embedding-provider.ts:76, b7b2e1f77eb4)
  • PR head adds GA model to the Embedding 2 set: PR head adds gemini-embedding-2 to GEMINI_EMBEDDING_2_MODELS, which routes it through the same request builders that still include taskType. (extensions/google/embedding-provider.ts:77, 66869a4f5981)
  • GA request path still serializes taskType: PR head keeps taskType in the request type and builder, and provider calls still pass task types for query and batch paths. (extensions/google/embedding-provider.ts:94, 66869a4f5981)
  • Official Gemini embedding contract: Google's current embeddings docs describe gemini-embedding-2 as the latest multimodal embedding model and state that task_type cannot be used with it; task intent should be included in prompt text instead. (ai.google.dev)
  • Official Gemini dimension contract: Google's current docs say gemini-embedding-2 defaults to 3072 dimensions, supports smaller output dimensionality, recommends 768/1536/3072, and documents 128 in the benchmark table. (ai.google.dev)
  • Preview remap changes index/cache identity: PR head normalizes gemini-embedding-2-preview to gemini-embedding-2; the adapter uses client.model in cacheKeyData, and memory-core treats model/provider-key changes as index identity mismatches. (extensions/google/embedding-provider.ts:240, 66869a4f5981)

Likely related people:

  • BillChirico: Authored the merged preview-support PR that added gemini-embedding-2-preview, output-dimensionality support, task-type handling, and Gemini request helpers now being upgraded. (role: introduced related preview behavior; confidence: high; commits: 60aed953468b; files: src/memory/embeddings-gemini.ts, extensions/google/embedding-provider.ts, docs/reference/memory-config.md)
  • gumadeiras: Merged the preview-support PR and authored follow-up Gemini normalization and multimodal image/audio indexing work tied to this provider path. (role: adjacent feature owner and merger; confidence: high; commits: 60aed953468b, 01ffc5db2478, d79ca5296054; files: src/memory/embeddings-gemini.ts, src/agents/memory-search.ts, extensions/google/memory-embedding-adapter.ts)
  • steipete: Moved memory embeddings into provider plugins and shaped the current Google provider-plugin owner boundary used by this PR. (role: recent adjacent refactor contributor; confidence: medium; commits: 77e6e4cf87f7, dbf78de7c680; files: extensions/google/embedding-provider.ts, extensions/google/memory-embedding-adapter.ts, extensions/memory-core/src/memory/embeddings.ts)
  • vincentkoc: Recent history touches memory docs/config references and release notes around the memory surface that must stay aligned with provider behavior. (role: recent memory docs/config contributor; confidence: medium; commits: a4b767c89bb9, 622bdfdad1a0, aa69b12d0086; files: docs/reference/memory-config.md, src/config/schema.help.ts)
  • Dallin Romney: Current-line blame for the extracted Google embedding provider files points to the recent commit that added those extension copies, though the behavior predates that extraction. (role: current file-layout contributor; confidence: low; commits: 5327340a09ed; files: extensions/google/embedding-provider.ts, extensions/google/memory-embedding-adapter.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-06-21T09:04:50.291Z sha 66869a4 :: needs real behavior proof before merge. :: [P1] Stop sending taskType with Gemini Embedding 2 | [P1] Make preview-to-GA remapping upgrade-safe | [P2] Update config guidance for GA dimensions

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 14, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed stale Marked as stale due to inactivity labels Jul 20, 2026
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Support Gemini Embedding 2 GA This is item 1/1 in the current shard. Shard 20/22.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor

Closing per ClawSweeper review verdict stalled_unproven_pr (decision packet 2026-07-21T20:26:27.496Z). This item was part of the audited close backlog (openclaw/clawsweeper#920) stranded by an apply-lane defect, drained manually after re-verification. If this is wrong, reopen and ClawSweeper will re-review.

@steipete steipete closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: google merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants