@setoelkahfi / sigit / commits / 484fce7

Switch default model to Qwen 3 8B and clean up code

paydii committed Apr 25, 2026 at 08:03 UTC 484fce782dedb177064c71f9443cdeb29e61994b
3 files changed +24 -26
src/chat.rs
+8 -1
index b44b4d5..513a485 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -311,6 +311,13 @@ struct ModelOption { } const SIGIT_MODELS: &[ModelOption] = &[ + ModelOption { + name: "Qwen 3 8B (Q4_K_M)", + description: "~5 GB", + tool_calling: true, + max_tokens: 4096, + config_fn: GgufModelConfig::qwen3_8b, + }, ModelOption { name: "Qwen 3 4B (Q4_K_M)", description: "~2.7 GB", @@ -999,7 +1006,7 @@ pub async fn run_with<B: ratatui::backend::Backend>( engine: Arc<ChatEngine>, load_rx: std_mpsc::Receiver<Result<(), String>>, ) -> Result<()> { - let config = GgufModelConfig::qwen3_4b(); + let config = GgufModelConfig::qwen3_8b(); let model_name = config.display_name.clone(); event_loop(terminal, engine, load_rx, model_name).await }
src/main.rs
+14 -23
index 55f485f..be6f66c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -215,15 +215,6 @@ impl SiGitAgent { session_cwd: std::sync::Mutex::new(None), } } - - /// Return the session working directory, falling back to the process cwd. - fn cwd(&self) -> PathBuf { - self.session_cwd - .lock() - .ok() - .and_then(|guard| guard.clone()) - .unwrap_or_else(|| std::env::current_dir().unwrap_or_else(|_| PathBuf::from("."))) - } } #[async_trait::async_trait(?Send)] @@ -280,10 +271,10 @@ impl Agent for SiGitAgent { // Set the process cwd so tool calls using relative paths land in the // correct project directory. - if args.cwd.is_dir() { - if let Err(err) = std::env::set_current_dir(&args.cwd) { - log::warn!("could not set cwd to {}: {err}", args.cwd.display()); - } + if args.cwd.is_dir() + && let Err(err) = std::env::set_current_dir(&args.cwd) + { + log::warn!("could not set cwd to {}: {err}", args.cwd.display()); } // Clear conversation history — siGit doesn't persist sessions, so a @@ -323,10 +314,10 @@ impl Agent for SiGitAgent { if let Ok(mut guard) = self.session_cwd.lock() { *guard = Some(args.cwd.clone()); } - if args.cwd.is_dir() { - if let Err(err) = std::env::set_current_dir(&args.cwd) { - log::warn!("could not set cwd to {}: {err}", args.cwd.display()); - } + if args.cwd.is_dir() + && let Err(err) = std::env::set_current_dir(&args.cwd) + { + log::warn!("could not set cwd to {}: {err}", args.cwd.display()); } // siGit doesn't persist history, so a fork is effectively a fresh @@ -365,10 +356,10 @@ impl Agent for SiGitAgent { if let Ok(mut guard) = self.session_cwd.lock() { *guard = Some(args.cwd.clone()); } - if args.cwd.is_dir() { - if let Err(err) = std::env::set_current_dir(&args.cwd) { - log::warn!("could not set cwd to {}: {err}", args.cwd.display()); - } + if args.cwd.is_dir() + && let Err(err) = std::env::set_current_dir(&args.cwd) + { + log::warn!("could not set cwd to {}: {err}", args.cwd.display()); } // Clear history — the model is already loaded. @@ -718,7 +709,7 @@ fn init_logging(is_tty: bool) { #[cfg(unix)] async fn run_interactive(tty: std::fs::File, mut cleanup_tty: std::fs::File) -> anyhow::Result<()> { let engine = Arc::new(ChatEngine::new()); - let config = GgufModelConfig::qwen3_4b(); + let config = GgufModelConfig::qwen3_8b(); let sampling = SamplingConfig { max_tokens: Some(4096), ..SamplingConfig::default() @@ -777,7 +768,7 @@ async fn run_acp_server() -> anyhow::Result<()> { log::info!("loading model (this may take a minute on first run)..."); let engine = Arc::new(ChatEngine::new()); - let config = GgufModelConfig::qwen3_4b(); + let config = GgufModelConfig::qwen3_8b(); let sampling = SamplingConfig { max_tokens: Some(4096), ..SamplingConfig::default()
src/tools.rs
+2 -2
index 116479a..816f24d 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -526,7 +526,7 @@ fn search_file(path: &Path, re: &Regex, matches: &mut Vec<String>) { } } -/// ── read_website ───────────────────────────────────────────────────────────── +// ── read_website ───────────────────────────────────────────────────────────── fn exec_read_website(arguments: &str) -> String { let args: Value = match serde_json::from_str(arguments) { @@ -642,7 +642,7 @@ fn exec_read_website(arguments: &str) -> String { output } -/// ── create_directory ───────────────────────────────────────────────────────── +// ── create_directory ───────────────────────────────────────────────────────── /// Create a directory and any missing parent directories. fn exec_create_directory(arguments: &str) -> String {