Give the responses-adapter fakes the subject the route now passes by lonexreb · Pull Request #9949 · unslothai/unsloth · GitHub
Skip to content

Give the responses-adapter fakes the subject the route now passes - #9949

Closed
lonexreb wants to merge 1 commit into
unslothai:mainfrom
lonexreb:fix/responses-adapter-fake-arity
Closed

lonexreb wants to merge 1 commit into
unslothai:mainfrom
lonexreb:fix/responses-adapter-fake-arity

Conversation

@lonexreb

Copy link
Copy Markdown
Contributor

What

Backend CI has been red on main for ~20 consecutive runs. One of the two failure families is 15 tests in test_responses_tool_passthrough.py dying on arity:

TypeError: fake_chat_completions() takes 2 positional arguments but 3 were given

Cause

37d3b6f (#8768) made the /v1/responses adapter pass current_subject positionally into openai_chat_completions, but the five fake_chat_completions stubs in this file still take (chat_req, request), so every test that drives the adapter dies before asserting anything.

Fix

Accept the third argument in the five stubs. Test-side only — the production call is correct (other patchers in the suite, e.g. test_chat_generation_supervisor.py and test_active_generations.py, already pass or accept the subject).

Verification

  • test_responses_tool_passthrough.py: 15 failed → 117 passed
  • Neighboring patchers of the same route (test_chat_generation_supervisor, test_active_generations, test_api_profile_usage_routes): 235 pass together
  • Ruff clean, formatter applied

Not in this PR

The other red family on main — 8 test_openai_auto_switch.py failures from the same #8768 (gguf_only capture KeyErrors and _host_has_a_non_gguf_backend probing real find_spec("torch") in a torch-less CI env) — needs per-test care; happy to follow up separately.

37d3b6f started passing current_subject positionally into
openai_chat_completions from the /v1/responses adapter, and the five
fake_chat_completions stubs in test_responses_tool_passthrough.py still
took (chat_req, request), so all 15 tests driving the adapter died on
arity before asserting anything. Backend CI has been red on main since.
Accept the third argument.
@lonexreb

Copy link
Copy Markdown
Contributor Author

@lonexreb

Copy link
Copy Markdown
Contributor Author

Status across the four repair PRs (#9949, #9956, #9957, #9958): each fixes one of the families keeping Backend CI's 3.13 leg red, so each still inherits the other three and none can show a green leg alone — together they green it (verified per-family on this leg's own runs). If a single combined PR is easier to review and merge, say the word and I'll stack the four into one branch — otherwise they merge cleanly in any order.

@lonexreb

Copy link
Copy Markdown
Contributor Author

@lonexreb lonexreb closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant