Skip to content

fix(embedder): add code model dimensions and actionable 422 error for Jina#928

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
deepakdevp:fix/jina-code-embedder-task-type
Mar 24, 2026
Merged

fix(embedder): add code model dimensions and actionable 422 error for Jina#928
qin-ctx merged 1 commit intovolcengine:mainfrom
deepakdevp:fix/jina-code-embedder-task-type

Conversation

@deepakdevp
Copy link
Copy Markdown
Contributor

Summary

  • Adds jina-code-embeddings-1.5b (1024) and jina-code-embeddings-0.5b (768) to JINA_MODEL_DIMENSIONS so dimension validation works correctly for code models
  • Adds _raise_task_error() helper that intercepts 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
  • Adds 3 new tests: 422 actionable error, non-422 passthrough, code model dimensions

Builds 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

  • All 23 Jina embedder tests pass (pytest tests/unit/test_jina_embedder.py)
  • test_422_task_error_actionable_message — verifies 422 with "task" in body produces actionable RuntimeError
  • test_non_422_error_passthrough — verifies non-422 errors use generic message
  • test_code_model_dimensions — verifies both code models resolve correct default dimensions
  • Ruff check and format clean

🤖 Generated with Claude Code

… 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.
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@qin-ctx qin-ctx merged commit df8ba97 into volcengine:main Mar 24, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: jina-code-embeddings-1.5b fails with retrieval.query task — incompatible task type passed to Jina API

2 participants