Skip to content

test(embedding): add regression tests for oversized-item token-limit fallback#16

Merged
AperturePlus merged 1 commit intodevelopfrom
codex/fix-indexing-error-for-oversized-items
Feb 25, 2026
Merged

test(embedding): add regression tests for oversized-item token-limit fallback#16
AperturePlus merged 1 commit intodevelopfrom
codex/fix-indexing-error-for-oversized-items

Conversation

@AperturePlus
Copy link
Owner

Motivation

  • Add a focused, fast regression test to validate that the embedding fallback behavior correctly handles a single permanently oversized item by inserting a zero-vector and continuing, while preserving the original behavior when fallback is disabled.

Description

  • Added tests/unit/test_embedding_client_fallback.py containing two unit tests that mock _embed_single_batch to: (1) ensure an oversized single item is replaced with a zero-vector placeholder and processing continues, and (2) ensure NonRetryableError is raised when batch fallback is disabled.

Testing

  • Ran uv run ruff check src tests which passed successfully.
  • Ran uv run pytest tests/unit/test_embedding_client_fallback.py -q which passed successfully.
  • Ran full test suite uv run pytest tests/ -v --tb=short -q --durations=10 which failed early due to pre-existing unrelated test failures.
  • Ran uv run mypy src --ignore-missing-imports --no-error-summary which reported existing repository mypy errors unrelated to this test-only change.

Codex Task

Why:
The oversized-item token-limit fix needs an explicit, fast regression test
that validates behavior without running the full property suite.

What:
- Added unit tests for OpenAIEmbeddingClient fallback behavior.
- Verified oversized single items are replaced with zero vectors and indexing can continue.
- Verified fallback-disabled mode still raises NonRetryableError.

Test:
- uv run ruff check src tests (pass)
- uv run pytest tests/unit/test_embedding_client_fallback.py -q (pass)
- uv run pytest tests/ -v --tb=short -q --durations=10 (fails in existing suite; interrupted after multiple pre-existing failures)
- uv run mypy src --ignore-missing-imports --no-error-summary (fails with pre-existing type errors)
@AperturePlus AperturePlus merged commit e596f5a into develop Feb 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant