Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(claude-code): gate the platform launchers so non-target builds stay clean

Nguyen Thanh Datbd4ab1604f9c
diff --git a/app/src-tauri/src/claude_code.rs b/app/src-tauri/src/claude_code.rs
index f802af29f2..c54809d51e 100644
--- a/app/src-tauri/src/claude_code.rs
+++ b/app/src-tauri/src/claude_code.rs
@@ -28,6 +28,10 @@ fn login_command_line() -> String {
}
/// Argv for `cmd /c start "" cmd /k <login command>`.
+/// Compiled when testing on any host too, so a Linux CI run still checks the
+/// Windows argv; otherwise only where it is actually spawned. Same for the
+/// macOS and Linux helpers below.
+#[cfg(any(test, target_os = "windows"))]
fn windows_launch_args() -> Vec<String> {
// `start ""` opens a new console window; the empty quoted title
// prevents cmd from interpreting the first arg as a title.
@@ -44,6 +48,7 @@ fn windows_launch_args() -> Vec<String> {
}
/// The AppleScript handed to `osascript`.
+#[cfg(any(test, target_os = "macos"))]
fn macos_launch_script() -> String {
format!(
r#"tell application "Terminal"
@@ -55,6 +60,7 @@ end tell"#,
}
/// Linux terminal emulators to try, in order, with the args each one needs.
+#[cfg(any(test, target_os = "linux"))]
fn linux_launch_candidates() -> Vec<(&'static str, Vec<String>)> {
let argv: Vec<String> = CLAUDE_LOGIN_ARGV.iter().map(|s| (*s).to_string()).collect();
let line = login_command_line();
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index 2b2092175f..9513d462b1 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -4293,7 +4293,8 @@ const messages: TranslationMap = {
'settings.ai.claudeCode.openingTerminal': '正在打开终端…',
'settings.ai.claudeCode.signIn': '使用 Claude 登录',
'settings.ai.claudeCode.reconnect': '重新连接',
- 'settings.ai.claudeCode.loginHint': '打开运行 claude auth login --claudeai 的终端。完成后,点击“重新检查”。',
+ 'settings.ai.claudeCode.loginHint':
+ '打开运行 claude auth login --claudeai 的终端。完成后,点击“重新检查”。',
'settings.ai.claudeCode.loginError': '无法打开登录终端。请重试。',
'settings.ai.claudeCode.fullAccess': '完全访问权限',
'settings.ai.claudeCode.fullAccessOn': 'Claude Code 可以运行命令、使用网络并生成子智能体。',