Repository navigation
Studio: show why the NPU model list failed in the chat model picker - #18528
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Tested on Strix Halo (Ubuntu 24.04, FastFlowLM 1.0.12, Lemonade 2026.44.1) at
Picker with the NPU list failing (left: main, then this PR on Discover and On Device): How this relates to #18549. Both PRs show the NPU list error in the picker on Discover. They cover different backend failures:
Picking and loading an NPU model still works on this PR at Not tested on a real Windows Smart App Control block. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
[skip ci]
|
@codex review |

Problem: When the NPU model list fails, the chat model picker hides the whole NPU section and shows no message. A user with a working NPU just sees no NPU models. This happened on a Windows laptop where Smart App Control blocked
lemond.exe.Change: The picker keeps the NPU section and shows why the list failed. The backend no longer answers a bare "Internal Server Error" for three failures. When
lemondcannot start or stops answering, it returns a readable error. An unreadable folder of converted models is skipped, and the list loads.Status: Tested live on the AMD DevLab Strix Halo runners, Linux and Windows, against
main.Why it happens
When
GET /api/npu/modelsfails, the error is stored inlistError. The Hub shows it, but the composer picker only draws the NPU notice before the runtime is ready. With no rows, the NPU section is dropped.Three backend failures also reached the route as unhandled exceptions (HTTP 500):
lemondcannot be spawned:PopenraisesOSError, for example when Smart App Control refuseslemond.exe.lemondstops answering after it started:LemonadeServer.requestraisesLemonadeUnavailable.PermissionErrorand fail the whole list.Fix
composer-model-picker.tsx,npu-rows.ts: Discover shows the NPU notice when the runtime is not ready or the list failed (npuNoticeShown). The notice already renderslistError.npu_backend.py: bothlemondfailures becomeNpuError, so the route answers 409 with the message. A Windows code integrity refusal gets the existingcode_integrity_user_messagethatllama-serveruses, which names Smart App Control. An exit status of 0xC0000602 alone is reported as a crash, since an ordinary crash can also exit with it.lemonade_server.py: keeps the exit status of alemondthat died during startup, read before Studio's own kill. One still running at the deadline is reported as a health check timeout.npu_local_models.py: an unreadable folder is skipped with a warning. Files are checked withlstat(), so on Python 3.14 a denied file is not mistaken for a missing one.Not changed
lemond.exe. This PR shows the block and names the fix.Testing
Live on DevLab Strix Halo:
mainandmainplus this PR side by side, NPU enabled on both.mainlemondcannot be spawned (Linux, Windows)lemondkilled, list requested while it exits (Linux)The DevLab Windows runner has Smart App Control off, so the real refusal (
winerror4551, exit status 0xC0E90002) is covered by unit tests only.New unit tests in
test_npu_backend.py,test_npu_local_models.pyandcomposer-npu-rows.test.tscover each case above, the code integrity messages and the startup timeout. The backend tests fail onmain. NPU backend tests: 554 passed, 1 skipped on Python 3.13; the two changed test files also pass on Python 3.14. Frontend typecheck and picker tests pass.