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\n\nCI caught two things this PR broke:\n\n- `windows_launch_args` and `macos_launch_script` are only called from\n `#[cfg]`-gated arms, so on the Linux lane they compiled into the lib\n unused and clippy's `-D dead_code` rejected them. Each helper is now\n gated on its own target.\n\n The gate is `any(test, target_os = ...)` rather than the bare target:\n keeping them compiled under `cfg(test)` is what lets the Linux CI run\n check the Windows and macOS argv, which is the reason they were pulled\n out into pure functions in the first place. All 8 tests still pass on a\n Windows host, so the `test` arm does hold every helper open.\n\n- The longer zh-CN hint pushed the line past prettier's print width.\n Reflowed by `prettier --write`; `prettier --check .` is clean.\n

Nguyen Thanh Dat2aafe0c8fabe
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 可以运行命令、使用网络并生成子智能体。',