fix: GET /v1/models und /v1/models/{id} zeigen nicht installierte Sprachmodelle nicht (#1146); Version 0.1.17-rc7

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg6sxZ8wsKZAVLQ6Xj5
This commit is contained in:
2026-11-21 23:19:10 +01:00
parent de43516029
commit cf5009453d
4 changed files with 47 additions and 9 deletions

View File

@ -53,6 +53,9 @@ impl Engine for FixedEngine {
capabilities: Capabilities::default(),
}
}
fn installed(&self, model: &str) -> bool {
!model.contains("fehlt")
}
async fn voices_reachable(&self) -> bool {
!self.studio_down.load(Ordering::SeqCst)
}
@ -653,6 +656,29 @@ async fn modellliste_zeigt_freigegebene_modelle_je_nach_rechten_auch_ungeladene(
assert_eq!(status, 200);
assert_eq!(body["object"], "list");
assert_eq!(ids(&body), ["bonsai", "sprecher", "zweit"]);
// #1146: Ein Sprachmodell, das im Studio nicht installiert ist, steht nicht im Katalog und lässt sich nicht abrufen.
gw.state
.store()
.register_llm(&NewLlm {
name: "sprecher-fehlt".to_string(),
engine: "tts".to_string(),
path: PathBuf::from("Qwen/Qwen3-TTS-12Hz-0.6B-fehlt"),
quantization: None,
size_bytes: None,
gpus: vec![0],
context: None,
vram_mb: None,
ram_mb: None,
idle_secs: None,
enabled: true,
})
.unwrap();
let (_, _, body) = gw.get("/v1/models", Some(&gw.key)).await;
assert_eq!(ids(&body), ["bonsai", "sprecher", "zweit"]);
let (status, _, _) = gw.get("/v1/models/sprecher-fehlt", Some(&gw.key)).await;
assert_eq!(status, 404);
let (status, _, _) = gw.get("/v1/models/sprecher", Some(&gw.key)).await;
assert_eq!(status, 200);
assert_eq!(body["data"][0]["object"], "model");
let (_, _, body) = gw.get("/v1/models", Some(&gw.key_bonsai)).await;
assert_eq!(ids(&body), ["bonsai"]);