test: TestOllamaFactoryMaxTokens references removed `max_tokens` field (3 pre-existing failures)

Open Beginner friendly
#3,744 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
testing

Research direction

Start with tests/unit/test_ollama_embedding_factory.py::TestOllamaFactoryMaxTokens and inspect EmbeddingModelConfig at embedding_config.py:97. Run the provided pytest command, then align the three outdated tests with the current schema and verify that the targeted test class no longer reports the three construction failures.

Written by the indexing model from the issue text.

Description

Problem

tests/unit/test_ollama_embedding_factory.py::TestOllamaFactoryMaxTokens has 3 tests that construct EmbeddingModelConfig(..., max_tokens=...). However, EmbeddingModelConfig no longer has a max_tokens field (the model sets extra="forbid" at embedding_config.py:97), so all 3 fail at construction time with:

pydantic_core._pydantic_core.ValidationError: 1 validation error for EmbeddingModelConfig
  max_tokens
    Extra inputs are not permitted

Affected tests

  • TestOllamaFactoryMaxTokens::test_custom_max_tokens_is_forwarded
  • TestOllamaFactoryMaxTokens::test_none_max_tokens_uses_default
  • TestOllamaFactoryMaxTokens::test_openai_factory_max_tokens_also_forwarded

Reproduction

./.venv/bin/python -m pytest -o addopts="" tests/unit/test_ollama_embedding_factory.py::TestOllamaFactoryMaxTokens -v

Root cause

The max_tokens field was removed from EmbeddingModelConfig in an earlier commit, but these tests were not updated. They appear to predate the schema change.

Impact

  • Fails on main baseline (unrelated to any recent PR).
  • Any CI run touching test_llama_embedding_factory.py shows 3 red, which can mask or be mistaken for real regressions introduced by other PRs.

Suggested fix

Either delete the TestOllamaFactoryMaxTokens class (if max_tokens is no longer a supported concept) or update the assertions to reflect the current schema (e.g., assert the field is rejected, or test whatever replaced it).

Context

Spotted while working on PR #2317 (ollama _provider attribution fix), which also modifies test_ollama_embedding_factory.py. These 3 failures are independent of that PR — confirmed via git stash comparison (same 3 fail on the base commit).

Dominant language
Python
Stars
38.1k
Forks
3k
Avg merge
1d 10h
Merged PRs (30d)
418

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from volcengine/OpenViking

All issues in volcengine/OpenViking

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.