chore: remove debug logging
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

Remove temporary console.log and eprintln! statements added during
troubleshooting the model configuration issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-23 23:06:20 +08:00
parent ae4bf815e3
commit cbd3da46a3
4 changed files with 200 additions and 184 deletions

View File

@@ -120,14 +120,10 @@ pub async fn kernel_init(
) -> Result<KernelStatusResponse, String> {
let mut kernel_lock = state.lock().await;
eprintln!("[kernel_init] Called with config_request: {:?}", config_request);
// Check if we need to reboot kernel with new config
if let Some(kernel) = kernel_lock.as_ref() {
// Get current config from kernel
let current_config = kernel.config();
eprintln!("[kernel_init] Current kernel config: model={}, base_url={}",
current_config.llm.model, current_config.llm.base_url);
// Check if config changed
let config_changed = if let Some(ref req) = config_request {
@@ -136,21 +132,14 @@ pub async fn kernel_init(
).llm.base_url;
let request_base_url = req.base_url.clone().unwrap_or(default_base_url.clone());
eprintln!("[kernel_init] Request config: model={}, base_url={}", req.model, request_base_url);
eprintln!("[kernel_init] Comparing: current.model={} vs req.model={}, current.base_url={} vs req.base_url={}",
current_config.llm.model, req.model, current_config.llm.base_url, request_base_url);
let changed = current_config.llm.model != req.model ||
current_config.llm.base_url != request_base_url;
eprintln!("[kernel_init] Config changed: {}", changed);
changed
current_config.llm.model != req.model ||
current_config.llm.base_url != request_base_url
} else {
false
};
if !config_changed {
// Same config, return existing status
eprintln!("[kernel_init] Config unchanged, reusing existing kernel");
return Ok(KernelStatusResponse {
initialized: true,
agent_count: kernel.list_agents().len(),
@@ -161,8 +150,6 @@ pub async fn kernel_init(
}
// Config changed, need to reboot kernel
eprintln!("[kernel_init] Config changed, rebooting kernel...");
// Shutdown old kernel
if let Err(e) = kernel.shutdown().await {
eprintln!("[kernel_init] Warning: Failed to shutdown old kernel: {}", e);
@@ -175,9 +162,6 @@ pub async fn kernel_init(
let api_key = req.api_key.as_deref().unwrap_or("");
let base_url = req.base_url.as_deref();
eprintln!("[kernel_init] Building config: provider={}, model={}, base_url={:?}, api_protocol={}",
req.provider, req.model, base_url, req.api_protocol);
zclaw_kernel::config::KernelConfig::from_provider(
&req.provider,
api_key,
@@ -192,8 +176,6 @@ pub async fn kernel_init(
let base_url = config.llm.base_url.clone();
let model = config.llm.model.clone();
eprintln!("[kernel_init] Final config: model={}, base_url={}", model, base_url);
// Boot kernel
let kernel = Kernel::boot(config.clone())
.await
@@ -203,8 +185,6 @@ pub async fn kernel_init(
*kernel_lock = Some(kernel);
eprintln!("[kernel_init] Kernel booted successfully with new config");
Ok(KernelStatusResponse {
initialized: true,
agent_count,