Skip to content

Multi-model serving tests: use the real NpuModel instead of a stub (m-r red since #18147) - #18197

Merged
danielhanchen merged 1 commit into
mainfrom
ci-npu-tests-real-model
Nov 17, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-npu-tests-real-model

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Two Studio tests fail on main since #18147 (m-r shard, seen on the staging run of #18188, a computer-use change):

tests/test_multi_model_serving.py::test_a_resident_npu_model_keeps_to_the_primarys_seat
routes/inference.py:10720: in _loaded_satisfies
E   AttributeError: 'types.SimpleNamespace' object has no attribute 'answers_to'
tests/test_multi_model_serving.py::test_the_loaded_models_list_names_the_npu_model_once
E   AttributeError: 'types.SimpleNamespace' object has no attribute 'display_name'

Cause

#18147 lets the API accept the NPU model name the app shows: NpuModel gained display_name and answers_to(), and the routing / loaded-models code now calls them. That is correct for the real class. These tests stand in for the resident NPU model with a SimpleNamespace carrying only the fields the code used before, so the new calls fail.

Fix

A _npu_model() helper builds the real npu_backend.NpuModel (frozen dataclass, model_path derived from id), and the four NPU stubs in the file use it. The surrounding backend stubs (is_loaded, resident) are unchanged. With the real class, a later method on NpuModel reaches these tests automatically instead of breaking them.

Verification

  • main: 2 failed, 108 passed.
  • this branch: tests/test_multi_model_serving.py 110 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 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-17T18:28:13.777654Z 35fe6c6 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. More of your lovely PRs please.

Reviewed commit: 35fe6c6056

ℹ️ 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".

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