Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

fix(qls-core): port-in-use hint points at Settings → Performance

Gabriele Lozupone9e795cf5b044
diff --git a/crates/qls-core/src/error.rs b/crates/qls-core/src/error.rs
index eb21b71..85cb63f 100644
--- a/crates/qls-core/src/error.rs
+++ b/crates/qls-core/src/error.rs
@@ -4,8 +4,6 @@
use serde::{Deserialize, Serialize};
use std::fmt;
-use crate::config::AppConfig;
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorCode {
@@ -158,7 +156,7 @@ pub fn translate_startup_failure(log_tail: &str) -> AppError {
}
if lc.contains("address already in use") || lc.contains("bind") && lc.contains("fail") {
return AppError::new(ErrorCode::ServerStartFailed, "The inference server port is already in use.")
- .suggest(&format!("Close the program using the port, or change \"serverPort\" in {}.", AppConfig::path().display()))
+ .suggest("Close the program using the port, or change the port in Settings → Performance.")
.detail(log_tail.to_string());
}
if lc.contains("cuda") && (lc.contains("no cuda") || lc.contains("cuda error") || lc.contains("no devices")) {
@@ -204,12 +202,11 @@ mod tests {
}
#[test]
- fn port_in_use_points_at_the_config_file() {
+ fn port_in_use_points_at_settings() {
let e = translate_startup_failure("bind() to 127.0.0.1:39150 failed: address already in use");
assert_eq!(e.code, ErrorCode::ServerStartFailed);
let s = e.suggestion.unwrap();
- assert!(s.contains("serverPort"), "{}", s);
- assert!(s.contains("config.json"), "{}", s);
+ assert!(s.contains("Settings → Performance"), "{}", s);
}
#[test]