Repository navigation
fix(google): support stable Gemini Embedding 2 request contracts - #128716
Conversation
Co-authored-by: Franck MEYER <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Merged via squash.
|
|
Codex review: found issues before merge. Reviewed August 24, 2026, 8:31 AM ET / 12:31 UTC. ClawSweeper reviewWhat this changesThe PR adds stable Gemini Embedding 2 request construction and dimension validation, preserves the preview identifier, and updates memory-index rebuild and multimodal documentation. Merge readinessKeep this maintainer-authored PR open: its new stable-model documentation lists four media formats, but the enabled runtime still admits the broader shared format set and sends those files to Gemini. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherMemory search classifies extra-path media, asks the Google plugin whether the chosen embedding model supports multimodal input, then sends inline media to Gemini and stores vectors in the memory index. This PR changes the Google plugin’s model-specific request and capability behavior. flowchart LR
A[Extra memory files] --> B[Shared media classifier]
B --> C[Google model capability]
C --> D[Embedding request builder]
D --> E[Gemini API]
E --> F[Memory index]
Decision needed
Why: The current capability seam is boolean-only, so aligning runtime behavior with the newly narrowed documentation requires an intentional provider-capability and compatibility direction. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +27, Tests +204, Docs +13. Total +244 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm Google’s stable media contract, then make the plugin/core admission boundary reject only the unsupported stable formats before provider I/O while retaining preview behavior and documenting the exact upgrade path. Do we have a high-confidence way to reproduce the issue? Yes: enable multimodal memory with stable Gemini Embedding 2 and place a shared-format file such as WebP or OGG under an extra path; source shows it is admitted and forwarded despite the changed documentation excluding it. Is this the best way to solve the issue? No: the request builder is the right owner for stable text contracts, but the PR leaves media admission inconsistent with its own supported-format contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 03658a99a950. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…nclaw#128716) * fix(memory): support stable Gemini Embedding 2 * fix(memory): validate async Gemini batch dimensions * docs(memory): explain stable Gemini index rebuild * docs(memory): cover explicit-dimension rebuilds * fix(google): honor stable Gemini embedding task contracts Co-authored-by: Franck MEYER <[email protected]> --------- Co-authored-by: Codex OpenClaw Migration <noreply@local> Co-authored-by: Franck MEYER <[email protected]>
Summary
gemini-embedding-2model in the owning Google memory plugin while preservinggemini-embedding-001and the existing preview identifier.taskType, apply documented task instructions for all seven existing task modes, and preserve asymmetric query/document instructions across direct, synchronous-batch, and asynchronous-batch requests.memory status --deepinspection, and correct Gemini-supported image/audio formats.Closes #120662.
Supersedes #120665, preserving all four original contributor commits. Thank you @fr-meyer for the original implementation, tests, documentation, and authenticated provider proof.
Why the additional repair is necessary
Google's embedding documentation explicitly states that the stable
gemini-embedding-2model does not supporttask_type; task instructions belong in text-only content instead. The original PR sent the unsupported field on direct requests and both batch paths. The Google plugin now owns one canonical, model-aware request builder and removes its redundant text-only wrapper.task: search result | query: ....title: none | text: ....Existing stable-model indexes already change identity because this fix starts resolving their previously omitted output dimensions. Operators therefore inspect first and explicitly rebuild rather than silently mixing incompatible vectors.
Real-provider verification
Two authenticated requests against the live Google Gemini API verified the corrected stable-model contract without exposing credentials, changing configuration, or mutating a memory index:
{ "model": "gemini-embedding-2", "query": { "httpStatus": 200, "taskTypeSent": false, "instruction": "task: search result | query: ...", "requestedDimensions": 768, "receivedDimensions": 768, "finiteValues": true }, "document": { "httpStatus": 200, "taskTypeSent": false, "instruction": "title: none | text: ...", "requestedDimensions": 768, "receivedDimensions": 768, "finiteValues": true }, "configurationChanged": false, "memoryIndexChanged": false, "credentialsRedacted": true }The original contributor additionally verified an authenticated stable-model 768-dimensional request and an existing live memory search returning three results without mutating its index; see #120665.
Focused regression coverage
taskType.taskTypefield.Production delta: +78/-51 (net +27), justified by stable-model support, provider-required request semantics, and vector-dimension integrity. Test delta: +232/-28.