fix(embedder): add code model dimensions and actionable 422 error for Jina#928
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom Mar 24, 2026
Merged
Conversation
… Jina Add jina-code-embeddings-1.5b and jina-code-embeddings-0.5b to JINA_MODEL_DIMENSIONS so dimension validation works correctly. Add _raise_task_error() helper that catches 422 validation errors mentioning 'task' and produces a user-friendly error message guiding users to set query_param and document_param in their embedding config. Fixes volcengine#912.
|
Failed to generate code suggestions for PR |
qin-ctx
approved these changes
Mar 24, 2026
zeattacker
pushed a commit
to zeattacker/OpenViking
that referenced
this pull request
Mar 25, 2026
… Jina (volcengine#928) Cherry-pick from upstream df8ba97 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jina-code-embeddings-1.5b(1024) andjina-code-embeddings-0.5b(768) toJINA_MODEL_DIMENSIONSso dimension validation works correctly for code models_raise_task_error()helper that intercepts 422 validation errors mentioningtaskand produces a user-friendly error message guiding users to setquery_paramanddocument_paramin their embedding configBuilds on the model-aware task defaults already merged in main. This PR completes the fix by adding the missing dimensions and improving the error experience when task types are misconfigured.
Fixes #912.
Test plan
pytest tests/unit/test_jina_embedder.py)test_422_task_error_actionable_message— verifies 422 with "task" in body produces actionable RuntimeErrortest_non_422_error_passthrough— verifies non-422 errors use generic messagetest_code_model_dimensions— verifies both code models resolve correct default dimensions🤖 Generated with Claude Code