fix: Vision-Test wertet llama.cpp-Ablehnung mit Status 500 als nein (#1157); Version 0.1.15-rc14

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg6k5Hxh8GpVW7od4Di
This commit is contained in:
2026-11-20 22:53:33 +01:00
parent 3c5367c079
commit 06048a2320
4 changed files with 36 additions and 8 deletions

12
Cargo.lock generated
View File

@ -700,7 +700,7 @@ dependencies = [
[[package]]
name = "nexus"
version = "0.1.15-rc13"
version = "0.1.15-rc14"
dependencies = [
"axum",
"nexus-adapter",
@ -715,7 +715,7 @@ dependencies = [
[[package]]
name = "nexus-adapter"
version = "0.1.15-rc13"
version = "0.1.15-rc14"
dependencies = [
"async-trait",
"libc",
@ -730,7 +730,7 @@ dependencies = [
[[package]]
name = "nexus-api"
version = "0.1.15-rc13"
version = "0.1.15-rc14"
dependencies = [
"async-trait",
"axum",
@ -750,7 +750,7 @@ dependencies = [
[[package]]
name = "nexus-core"
version = "0.1.15-rc13"
version = "0.1.15-rc14"
dependencies = [
"argon2",
"serde",
@ -761,14 +761,14 @@ dependencies = [
[[package]]
name = "nexus-scheduler"
version = "0.1.15-rc13"
version = "0.1.15-rc14"
dependencies = [
"nexus-core",
]
[[package]]
name = "nexus-store"
version = "0.1.15-rc13"
version = "0.1.15-rc14"
dependencies = [
"nexus-core",
"rusqlite",

View File

@ -3,7 +3,7 @@ resolver = "3"
members = ["crates/nexus-core", "crates/nexus-scheduler", "crates/nexus-store", "crates/nexus-adapter", "crates/nexus-api", "crates/nexus"]
[workspace.package]
version = "0.1.15-rc13"
version = "0.1.15-rc14"
edition = "2024"
license = "MIT"
repository = "ssh://git@git.wlkns.org:2222/wlkns-dev/nexus.git"

File diff suppressed because one or more lines are too long

View File

@ -241,6 +241,17 @@ pub fn antwort_zu(text: &str, nr: usize) -> String {
/// Wertet die Gesamtantwort aus: Anzahl richtiger Antworten. `None`, wenn die Antwort nicht auswertbar ist.
pub fn vision_richtige(status: u16, body: &str) -> Result<usize, Ausgang> {
// llama.cpp antwortet auf Bilder an ein Modell ohne mmproj mit Status 500 und dem Text
// „image input is not supported“ (gemessen am 20.11.2026 mit bonsai). Das ist eine ausdrückliche
// Ablehnung, auch ohne 4xx; andere Serverfehler bleiben unklar.
if status >= 500 {
let b = body.to_lowercase();
return if b.contains("image input is not supported") || b.contains("mmproj") {
Ok(0)
} else {
Err(Ausgang::Unklar)
};
}
if (400..500).contains(&status) {
let b = body.to_lowercase();
// Die Engine lehnt Bilder ausdrücklich ab: Das Modell sieht keine Bilder.
@ -635,4 +646,21 @@ mod tests {
fn drei_fragen() {
assert_eq!(FRAGEN.len(), 3);
}
#[test]
fn llama_cpp_ablehnung_mit_status_500_zaehlt_als_nein() {
// Echte Antwort von llama.cpp auf srv04 für ein Modell ohne mmproj (bonsai, 20.11.2026).
let body = r#"{"error":{"code":500,"message":"image input is not supported - hint: if this is unexpected, you may need to provide the mmproj","type":"server_error"}}"#;
assert_eq!(vision_richtige(500, body), Ok(0));
assert_eq!(vision_urteil(0), Urteil::Nein);
// Ein anderer Serverfehler bleibt unklar.
assert_eq!(
vision_richtige(500, r#"{"error":"out of memory"}"#),
Err(Ausgang::Unklar)
);
assert_eq!(
vision_richtige(503, "Service Unavailable"),
Err(Ausgang::Unklar)
);
}
}