fix: avoid retrying invalid embedding dimensions#1687
Conversation
5e332b6 to
8259d6a
Compare
|
@ai-ag2026 quick coordination question on this and #1670: since #1687's classifier covers both the pgvector native error (firing on main today) and the preflight validator from #1670 (not yet merged), is there a preferred merge order in your head? specifically:
happy with whichever — just want to make sure they don't end up in a half-merged state where one waits indefinitely on the other. |
|
Updated this PR with the generated-file refresh from the CI failure:
That produced the three expected generated-file deltas and the branch now points at On merge order with #1670: I think this PR can land first. The classifier here covers the pgvector-native dimension mismatch that can fire on current Local verification after regeneration:
|
Summary
Classify deterministic embedding-dimension failures as non-retryable worker errors, so poisoned embedding responses fail immediately instead of burning worker slots through the generic retry path.
Context
This complements #1670, but no longer depends on it: this PR now applies cleanly on current
mainand catches both the preflight validation error shape and pgvector's native dimension-mismatch error shape.Changes
_is_non_retryable_task_error()for deterministic worker failure classification.embedding 0 has dimension 0; expected 384different vector dimensions 384 and 0Verification
origin/main(113d7da9) and cherry-picked onlyfix: avoid retrying invalid embedding dimensions.env HINDSIGHT_API_LLM_PROVIDER=mock HINDSIGHT_API_LLM_MODEL=mock HINDSIGHT_API_LLM_API_KEY=mock uv run --extra embedded-db --extra local-ml pytest -n0 tests/test_integrity_violation_not_retried.py -q→ 5 passed, 2 warningsuv run ruff check hindsight_api/engine/memory_engine.py tests/test_integrity_violation_not_retried.py→ passeduv run python -m py_compile hindsight_api/engine/memory_engine.py tests/test_integrity_violation_not_retried.py→ passedAI usage disclosure
Prepared with AI assistance (TARS/Codex) using TDD, targeted local tests, and manual diff review.