Skip to content

Tests: bind the sampling defaults route stub to the real extra-slot router - #19351

Merged
danielhanchen merged 1 commit into
mainfrom
ci/sampling-defaults-route-stub-signature
Nov 24, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/sampling-defaults-route-stub-signature

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

studio/backend/tests/test_sampling_defaults_route.py::test_a_kept_model_resolves_against_its_own_slot fails on main since #19169 (load a second quant of a loaded GGUF repo beside it):

TypeError: test_a_kept_model_resolves_against_its_own_slot.<locals>.route() got an unexpected keyword argument 'touch'

Cause

#19169 gave _route_to_extra_slot a touch: bool = True parameter, and read-only callers such as get_sampling_defaults now pass touch = False so looking up a kept model's defaults does not refresh its place in the eviction order. The test replaces _route_to_extra_slot with a stub that only takes requested, so the call now raises. The route is right; the stub fell behind its signature.

Fix

Test only:

  • the stub takes *args, **kwargs and binds them with inspect.signature of the real _route_to_extra_slot, so it accepts exactly what the real router accepts and still fails if the route passes something the router does not;
  • the test now also checks what the route passed: one call, with touch = False. Reading defaults is not a use of the kept model.

Verification

  • tests/test_sampling_defaults_route.py: 5 passed (1 failed on main at 5ea3aec943).
  • Dropping touch = False from the call in get_sampling_defaults makes the new assertion fail with [True] == [False].

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T21:36:57.439833Z 91f1fc4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 91f1fc4f4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 5e2dc3e into main Nov 24, 2026
1 of 19 checks passed
@danielhanchen
danielhanchen deleted the ci/sampling-defaults-route-stub-signature branch November 24, 2026 21:39
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