Repository navigation
Conversation
Remove POST /api/v1/evaluations, POST /api/v1/evaluations/datasets and
POST /api/v1/evaluations/{id}/improve-prompt in favour of their v2
equivalents. The v1 GET/DELETE reads stay because v2 has no read
endpoints yet.
With the v1 create gone, the OpenAI/Gemini batch pipeline for text
evals (crud/evaluations/batch.py, processing.py, the
run_evaluation_batch_submission task and its cron polling) and the
embedding batch go too; only the cosine helpers used to read historical
runs remain. Dataset upload always stores the CSV in object storage.
Tests move to the v2 endpoints.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
Beyond the inline finding, I searched the backend for leftover references to the removed crud/evaluations/processing.py and batch.py modules and to start_evaluation_batch_submission/run_evaluation_batch_submission. None remain, so the deletions shouldn't cause an import error at startup.
Extended reasoning...
The PR removes about 6.8k lines of v1 text-evaluation write endpoints and the OpenAI/Gemini batch pipeline. A grep found no remaining callers of the deleted modules or Celery task; the STT/TTS cron paths now use their own helpers.
| session=session | ||
| ) | ||
|
|
||
| total_processed = ( | ||
| text_summary["processed"] | ||
| + stt_summary["processed"] | ||
| + tts_summary["processed"] | ||
| ) | ||
| total_failed = ( | ||
| text_summary["failed"] + stt_summary["failed"] + tts_summary["failed"] | ||
| ) | ||
| total_processed = stt_summary["processed"] + tts_summary["processed"] | ||
| total_failed = stt_summary["failed"] + tts_summary["failed"] | ||
| total_still_processing = ( | ||
| text_summary["still_processing"] | ||
| + stt_summary["still_processing"] | ||
| + tts_summary["still_processing"] | ||
| ) | ||
| all_details = ( | ||
| text_summary.get("details", []) | ||
| + stt_summary.get("details", []) | ||
| + tts_summary.get("details", []) | ||
| stt_summary["still_processing"] + tts_summary["still_processing"] | ||
| ) | ||
| all_details = stt_summary.get("details", []) + tts_summary.get("details", []) |
There was a problem hiding this comment.
🔴 Text batch evaluation runs still in flight at deploy time stay stuck in processing or pending forever. Nothing polls them, fails them or completes them after this change. The cron no longer calls poll_all_pending_evaluations, and no migration or sweep closes the open run_mode='batch' runs. Queued run_evaluation_batch_submission messages are now unregistered Celery tasks, so workers drop them. Fix: close every open batch run on deploy. For example, add a data migration or a one-off cron step that marks type='text', run_mode='batch' runs in pending/processing as failed with an explanatory error_message. [also at: backend/app/crud/evaluations/cron.py:166 - Text batch evaluation runs still in flight at deploy will stay pending/processing forever, and their OpenAI batch results are never collected.]
Why this was flagged
The trigger is any text run created through the removed POST /api/v1/evaluations with run_mode=batch that has not finished when this deploys. That covers runs waiting on an OpenAI/Gemini response or embedding batch, and Celery messages for run_evaluation_batch_submission still in the queue. On the base branch, process_all_pending_evaluations (cron.py:159) called poll_all_pending_evaluations, which finished or failed these runs. After the change, only STT/TTS runs are polled. dispatch_fast_evaluation_barriers (cron.py:41-45) filters on run_mode == RunModeEnum.FAST.value, so it skips batch runs. The Celery task was deleted from job_execution.py, so a redelivered or queued message hits an unregistered task and is discarded. The EvaluationRun row never leaves pending/processing. GET /api/v1/evaluations/{id} keeps reporting it as in progress, and the provider batch cost is lost. The diff adds no migration or sweep for these rows.
Verification: On the base commit, process_all_pending_evaluations started with text_summary = await poll_all_pending_evaluations(session=session). The diff deletes that call and the import from cron.py, so cron now polls only STT and TTS. The only other sweep left in cron.py (lines 42-44) filters on run_mode == RunModeEnum.FAST.value, so batch runs are never picked up.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
OpenAPI changes 🔴 21 breaking changesCaution Downstream consumers may need an update before merging. Breaking changes ·
|
| Method | Path | Change | |
|---|---|---|---|
| 🔴 | GET |
/api/v1/documents/transformation |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/documents/transformation/{job_id} |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/evaluations |
API removed without deprecation |
| 🔴 | POST |
/api/v1/evaluations/datasets |
API removed without deprecation |
| 🔴 | POST |
/api/v1/evaluations/{evaluation_id}/improve-prompt |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/fine_tuning/fine_tune |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/fine_tuning/{document_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/fine_tuning/{fine_tuning_id}/refresh |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/model_evaluation/evaluate_models |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/model_evaluation/{document_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/model_evaluation/{document_id}/top_model |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation/ancestor/{ancestor_response_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation/response/{response_id} |
API path removed without deprecation |
| 🔴 | DELETE |
/api/v1/openai-conversation/{conversation_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation/{conversation_id} |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/responses |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/responses/sync |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/documents |
removed the request property callback_url |
| 🔴 | POST |
/api/v1/documents |
removed the request property target_format |
| 🔴 | POST |
/api/v1/documents |
removed the request property transformer |
Full changelog · 50
| Method | Path | Change | |
|---|---|---|---|
| 🔴 | GET |
/api/v1/documents/transformation |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/documents/transformation/{job_id} |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/evaluations |
API removed without deprecation |
| 🔴 | POST |
/api/v1/evaluations/datasets |
API removed without deprecation |
| 🔴 | POST |
/api/v1/evaluations/{evaluation_id}/improve-prompt |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/fine_tuning/fine_tune |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/fine_tuning/{document_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/fine_tuning/{fine_tuning_id}/refresh |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/model_evaluation/evaluate_models |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/model_evaluation/{document_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/model_evaluation/{document_id}/top_model |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation/ancestor/{ancestor_response_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation/response/{response_id} |
API path removed without deprecation |
| 🔴 | DELETE |
/api/v1/openai-conversation/{conversation_id} |
API path removed without deprecation |
| 🔴 | GET |
/api/v1/openai-conversation/{conversation_id} |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/responses |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/responses/sync |
API path removed without deprecation |
| 🔴 | POST |
/api/v1/documents |
removed the request property callback_url |
| 🔴 | POST |
/api/v1/documents |
removed the request property target_format |
| 🔴 | POST |
/api/v1/documents |
removed the request property transformer |
| 🟢 | — |
— |
removed the schema APIResponse_CallbackResponse_ |
| 🟢 | — |
— |
removed the schema APIResponse_DocTransformationJobPublic_-Input |
| 🟢 | — |
— |
removed the schema APIResponse_DocTransformationJobPublic_-Output |
| 🟢 | — |
— |
removed the schema APIResponse_DocTransformationJobsPublic_ |
| 🟢 | — |
— |
removed the schema APIResponse_FineTuningJobPublic_ |
| 🟢 | — |
— |
removed the schema APIResponse_ModelEvaluationPublic_ |
| 🟢 | — |
— |
removed the schema APIResponse_OpenAIConversationPublic_ |
| 🟢 | — |
— |
removed the schema APIResponse_ResponseJobStatus_ |
| 🟢 | — |
— |
removed the schema APIResponse_list_FineTuningJobPublic__ |
| 🟢 | — |
— |
removed the schema APIResponse_list_ModelEvaluationPublic__ |
| 🟢 | — |
— |
removed the schema APIResponse_list_OpenAIConversationPublic__ |
| 🟢 | — |
— |
removed the schema Body_Evaluation-evaluate |
| 🟢 | — |
— |
removed the schema Body_Evaluation-upload_dataset |
| 🟢 | — |
— |
removed the schema Body_Fine_Tuning-fine_tune_from_CSV |
| 🟢 | — |
— |
removed the schema CallbackResponse |
| 🟢 | — |
— |
removed the schema Diagnostics |
| 🟢 | — |
— |
removed the schema DocTransformationJobPublic |
| 🟢 | — |
— |
removed the schema DocTransformationJobsPublic |
| 🟢 | — |
— |
removed the schema FineTuningJobPublic |
| 🟢 | — |
— |
removed the schema ModelEvaluationCreate |
| 🟢 | — |
— |
removed the schema ModelEvaluationPublic |
| 🟢 | — |
— |
removed the schema ModelEvaluationStatus |
| 🟢 | — |
— |
removed the schema OpenAIConversationPublic |
| 🟢 | — |
— |
removed the schema ResponseJobStatus |
| 🟢 | — |
— |
removed the schema ResponsesAPIRequest |
| 🟢 | — |
— |
removed the schema ResponsesSyncAPIRequest |
| 🟢 | — |
— |
removed the schema TransformationJobInfo |
| 🟢 | — |
— |
removed the schema TransformationStatus |
| 🟢 | POST |
/api/v1/documents |
removed the optional property data/anyOf[subschema #1: DocumentUploadResponse]/transformation_job from the response with the 200 status |
main ↔ eb7fc62d · generated by oasdiff
Issue
Closes #1382
What Changed
POST /api/v1/evaluations,POST /api/v1/evaluations/datasetsandPOST /api/v1/evaluations/{id}/improve-prompt. The v1GET/DELETEroutes stay; all writes now go through/api/v2.crud/evaluations/batch.pyandprocessing.pyembeddings.pyrun_evaluation_batch_submissionCelery task andstart_evaluation_batch_submissionvalidate_and_start_batch_evaluationupload_dataset: removeduse_langfuse. The Langfuse upload is gone, and the S3 upload changed from best-effort to mandatory (500 on failure).create_evaluation_rundefaultrun_mode:BATCH→FAST.fetch_dataset_itemsmoved frombatch.pytolangfuse.py, so legacy Langfuse-backed datasets can still run on v2./api/v2/evaluations.Summary
Route surface:
Cron call tree:
Dataset upload:
Evidence
TestV1TriggerUnchanged.test_v1_fast_run_is_not_a_judge_runexpected the v1 write route to work:TestV1WriteRoutesRemoved(intest_evaluation_v2.py) expects:/api/v1/evaluations/datasets. It covered description persisted, empty rows skipped, and missing columns returning 422.After: the same cases run against
/api/v2/evaluations/datasetsintest_evaluation_dataset_v2.py.test_object_store_exception_raises_500was added for the now-mandatory S3 upload.TestFetchDatasetItemswas added totest_langfuse.pyfor the relocated legacy-dataset reader.Merge Danger
Door: two-way
This is a pure code removal with no migrations and no schema changes. Reverting the PR restores everything.
There is one soft edge. Any text run still in
run_mode=batch/status=processingat deploy time will no longer be polled and will stayprocessing. Historical batch rows remain readable.Blast Radius: Medium
POSTroutes gets 405/404. The frontend and integrations must already be on/api/v2.run_evaluation_batch_submissionthat are queued at deploy time will fail as an unregistered task.Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Previous PR description
Issue
Closes #1382
Summary
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes