Repository navigation
test(integration): cover responses endpoint contracts - #44733
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Isolate team-only response-id ownership with a same-user different-team key, send every denial through the OpenAI SDK on all three aliases, make the previous_response_id affinity check deterministic, assert the whole cancel response, prove the Cursor stream text, -fast suffixes and include_obfuscation strip, add SDK compact cases, restore router pre-call checks after the affinity test, and inline the root-level responses_test_support helpers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…deployments Restore the cross-worker convergence wait dropped when the shared helper was inlined, so the affinity and retrieve-routing tests cannot pass before the alternative deployment is loaded on a multi-worker gateway Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…through body Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@litereview code-review |
|
bugbot run |
✅ code-review5/5 · Ready for human reviewScope: full · Full PR review. Completed · Some checks not run. No correctness findings. This PR changes test code only. It adds five integration test files and one readiness helper under Checks and execution details
View review · Reviewed |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@litereview code-review |
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@litereview code-review |
|
bugbot run |
|
@litereview code-review |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c6d5df0. Configure here.
TLDR
Problem this solves:
How it solves it:
Screenshots / Proof of Fix
This PR changes test coverage only and has no user-visible before-and-after behavior. The local integration tests use a real proxy and scripted upstream to verify exact request and response contracts
What is covered
The tests exercise Responses ownership, lifecycle, compact, previous-response affinity, typed metadata, and Cursor request and response translation across the supported route aliases
The create test is
test_allow_unmanaged_response_ids_forward_the_vendor_id_on_create. The streamed-ID test now retrieves the streamed ID, compares the full response, and checks the exact upstream GETTests and mutation proofs
Evidence and local runs below are at
1851524b67. Commit94eebaec13then made the Cursor and compact registrations wait for every worker, and both files passed again (38 passed, 5 BUG skips). Commitf98a4715d2makes readiness track each worker by pairing/debug/memory/summaryworker_pid with/model/infoon one connection, and returns only when every worker reports the deploymentallow_unmanaged_response_idstest_allow_unmanaged_response_ids_forward_the_vendor_id_on_create,test_responses_id_ownership.py:351Forbidden. This response id was not issued by this proxyprevious_response_idfromResponsesAPIOptionalRequestParamstest_responses_id_ownership.py:388previous_response_idwas missingtest_responses_id_ownership.py:382synthetic-env-fallback-keytest_retrieve_routes_to_the_deployment_that_created_the_response,test_responses_lifecycle_wire.py:173status: failed, expectedstatus: completedtest_responses_metadata_reaches_the_provider_as_typed,test_responses_core_wire.py:371test_responses_core_wire.py:371/v1/responsesin the create-route settest_responses_lifecycle_wire.py:270with HTTP 403,Forbidden. This response id was not issued by this proxyreasoning_effortinjectiontest_cursor_messages_body_uses_chat_completions_wire[False--thinking-low-low],test_cursor_responses_wire.py:412reasoning_effort: lowcompletion_tokensto 99test_cursor_messages_body_uses_chat_completions_wire[False--],test_cursor_responses_wire.py:384Each mutant was applied alone, the shared proxies were restarted, and the focused test failed at the listed assertion. The product mutation was restored before the green integration runs
The earlier Cursor suffix mutant failed at
test_cursor_responses_wire.py:190, forwardingreasoning.effort: highinstead oflow. The reviewer also reported C1 failing withmodel=None no healthy deploymentsand B1, H1, K1, E1, F1, K2, and K3 killed atd2dae45The streamed retrieve passed three consecutive runs for
/v1, ``, and/openai/v1. The exact upstream request list includes the stream POST and retrieve GETThe unmanaged-create retrieve passed through
allowed_gateway. Removing the unmanaged lifecycle skip made retrieve fail attest_responses_id_ownership.py:440with HTTP 400,You passed in model=None. There are no healthy deployments for this modelThe input-items
includeprobe failed on all aliases because upstream received onlylimit=20&order=desc. Its assertion remains under the existing BUG skipCursor Chat suffix cases include empty,
none,minimal,low,medium,high, andmax.xhighis excluded because GPT-5 returns 400 before the scripted upstream receives the requestRuns
make checkpassedType
Test
Caveats
Medium
test_compact_previous_response_id_is_scoped_to_the_issuing_user_and_teamremains skipped for a cross-tenant product bug filed as its own internal P0 tickettest_allow_unmanaged_response_id_lifecycle_route_reaches_providerremains skipped for unmanaged retrieve, delete, cancel, and input-items routestest_retrieve_returns_the_id_the_client_holdsandtest_retrieve_query_reaches_the_providerremain skipped for ID equality and retrieve query forwardingtest_compact_previous_response_id_reaches_the_provider_as_the_raw_idremains skipped for compact previous-response forwardingtest_conversation_is_forwarded_as_a_separate_responses_parameterremains skipped because conversation is droppedtest_delete_returns_the_client_held_id_not_the_provider_iddocuments that delete returns the provider ID, which the green delete test acceptstest_input_items_pagination_query_reaches_the_providerremains skipped because pagination and include are droppedtest_cursor_stream_reports_usage_when_the_client_asks_for_itremains skipped because Cursor omits the usage chunktest_cursor_responses_body_carries_no_proxy_metadataremains skipped because Cursor forwards proxy metadata, which the green Responses test filtersPre-Submission checklist
make checkpassesFinal Attestation
Note
Low Risk
Test-only changes with no runtime or security behavior modifications; skipped tests document existing product bugs without altering the proxy.
Overview
Adds integration test coverage for LiteLLM proxy Responses API and Cursor routes, plus a shared
wait_for_worker_readinesshelper so deployments are visible on every proxy worker before assertions run.New suites use scripted upstream wire servers to assert exact provider requests and client-facing responses: user/team response-id ownership (403 on cross-tenant access), lifecycle (retrieve affinity, delete/cancel, streamed IDs), compact routes and SDK bodies, previous_response_id raw-id forwarding and deployment affinity, metadata typing/limits, and Cursor translation (Responses vs chat-completions wire, suffixes, streaming).
Several cases stay
pytest.skipwith BUG notes for known gaps (compact ownership, unmanaged lifecycle routes, retrieve query params, conversation param, Cursor metadata/usage, etc.). No production code changes—tests and the readiness helper only.Reviewed by Cursor Bugbot for commit c6d5df0. Bugbot is set up for automated code reviews on this repo. Configure here.