feat: 使用 platform 模块获取 Shell 信息,优化系统环境信息提示词生成

This commit is contained in:
oudecheng 2026-05-20 15:55:23 +08:00
parent fc628239a4
commit 881c73c79f

View File

@ -84,7 +84,9 @@ pub fn generate_system_env_prompt(config: &crate::config::LLMProviderConfig) ->
_ => OS,
};
let shell = env::var("SHELL").unwrap_or_else(|_| "unknown".to_string());
// 使用 platform 模块获取 Shell 信息,与 bash 工具保持一致
let shell_info = crate::platform::ShellInfo::default();
let shell = shell_info.executable;
let cwd = env::current_dir()
.map(|p| p.display().to_string())
.unwrap_or_else(|_| "unknown".to_string());