Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 28, 2026

This PR removes the deprecated text-embedding-004 model and adds automatic migration to gemini-embedding-001 for backward compatibility.

Changes

  • Remove text-embedding-004 from model profiles: The text-embedding-004 entry has been removed from EMBEDDING_MODEL_PROFILES in embeddingModels.ts
  • Add migration logic in GeminiEmbedder: Added a DEPRECATED_MODEL_MIGRATIONS map and migrateModelId() method that silently converts text-embedding-004 to gemini-embedding-001
  • Update documentation: Updated comments in gemini.ts to reflect the supported model and migration behavior
  • Update tests: Added new test case for the migration behavior

Why

The text-embedding-004 model is deprecated and should no longer be used. By adding automatic migration, users who have text-embedding-004 configured will continue to work without interruption - their requests are silently redirected to gemini-embedding-001.

Testing

  • All existing tests pass
  • Added new test to verify deprecated model migration works correctly
  • TypeScript compilation passes
  • Linting passes

View task on Roo Code Cloud


Important

Remove deprecated text-embedding-004 model and migrate to gemini-embedding-001 with backward compatibility in embeddingModels.ts and gemini.ts.

  • Behavior:
    • Remove text-embedding-004 from EMBEDDING_MODEL_PROFILES in embeddingModels.ts.
    • Add DEPRECATED_MODEL_MIGRATIONS map and migrateModelId() in GeminiEmbedder to migrate text-embedding-004 to gemini-embedding-001.
    • Update comments in gemini.ts to reflect migration behavior.
  • Tests:
    • Add test case in gemini.spec.ts to verify migration from text-embedding-004 to gemini-embedding-001.
    • Update service-factory.spec.ts to test migration logic in GeminiEmbedder.
    • Add tests in embeddingModels.spec.ts to ensure backward compatibility for dimension lookups.
  • Misc:
    • Ensure text-embedding-004 is retained in EMBEDDING_MODEL_PROFILES for dimension lookup compatibility.

This description was created by Ellipsis for 04b4a69. You can customize this summary. It will automatically update as commits are pushed.

…te to gemini-embedding-001

- Remove text-embedding-004 from EMBEDDING_MODEL_PROFILES
- Add automatic migration in GeminiEmbedder for backward compatibility
- Users with text-embedding-004 configured are silently migrated to gemini-embedding-001
- Update tests to reflect the changes
@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. All previously flagged issues have been resolved. The new test file provides good coverage for the backward compatibility fix.

  • Vector store dimension lookup breaks for migrated users - Fixed by keeping text-embedding-004 in EMBEDDING_MODEL_PROFILES with the correct dimension (3072) for backward-compatible dimension lookup.
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

},
gemini: {
"text-embedding-004": { dimension: 768 },
"gemini-embedding-001": { dimension: 3072, scoreThreshold: 0.4 },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing text-embedding-004 from the profiles breaks the silent migration for users who have it configured. When createVectorStore() in service-factory.ts calls getModelDimension("gemini", "text-embedding-004"), it will return undefined because the model is no longer in the profiles, causing an error. The migration in GeminiEmbedder only affects embedder creation, not dimension lookup.

Consider either: (1) keeping text-embedding-004 in the profiles pointing to the migrated model's dimension (3072), or (2) exporting the migration logic from GeminiEmbedder and applying it in service-factory.ts before calling getModelDimension().

Fix it with Roo Code or mention @roomote and request a fix.

@hannesrudolph hannesrudolph marked this pull request as ready for review January 28, 2026 04:44
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jan 28, 2026
@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issue. All local checks passed.

View commit | Revert commit

@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. The previously flagged issue remains unresolved.

  • Vector store dimension lookup breaks for migrated users - Removing text-embedding-004 from EMBEDDING_MODEL_PROFILES causes createVectorStore() to fail for users with this model configured, since getModelDimension() returns undefined. The migration logic in GeminiEmbedder only covers embedder creation, not dimension lookup.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Fixaroo Clock   See task on Roo Cloud

Added tests to verify the dimension lookup fix for deprecated text-embedding-004 model. All local checks passed.

View commit | Revert commit

…n embeddingModels

Adds comprehensive tests for embeddingModels.ts to verify:
- text-embedding-004 is present in gemini profiles for backward compatibility
- getModelDimension returns 3072 for deprecated text-embedding-004
- Ensures createVectorStore works for users with text-embedding-004 configured
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants