Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
model: "claude-opus-4-20250514"
# Optional: Specify model (defaults to Claude Sonnet 4.6, uncomment for Claude Opus 4.7)
model: "claude-opus-4-7"

# Optional: Customize the trigger phrase (default: @claude)
# trigger_phrase: "/claude"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ AGENTS.md
# Claude project-specific files
.claude/

# Superpowers-ZH (本地 skills 框架,由 npx superpowers-zh 生成)
.codex/
CLAUDE.md

# Provider configurations (contains sensitive API keys)
providers.json
hidden_projects.json
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "any-code",
"private": true,
"version": "5.28.5",
"version": "5.29.0",
"license": "AGPL-3.0",
"type": "module",
"scripts": {
Expand Down Expand Up @@ -43,6 +43,7 @@
"@tauri-apps/plugin-fs": "^2.4.4",
"@tauri-apps/plugin-global-shortcut": "^2.3.1",
"@tauri-apps/plugin-http": "^2.5.4",
"@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-opener": "^2.5.2",
"@tauri-apps/plugin-process": "^2.3.1",
"@tauri-apps/plugin-shell": "^2.3.3",
Expand Down Expand Up @@ -80,6 +81,8 @@
},
"trustedDependencies": [
"@parcel/watcher",
"@tailwindcss/oxide"
"@tailwindcss/oxide",
"esbuild",
"sharp"
]
}
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "any-code"
version = "5.28.5"
version = "5.29.0"
description = "Any Code - Professional desktop application and toolkit for AI CLI"
authors = ["mufeedvh", "123vviekr"]
license = "AGPL-3.0"
Expand Down
4 changes: 4 additions & 0 deletions src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
"process:allow-restart",
"process:allow-exit",
"clipboard-manager:allow-write-text",
"notification:default",
"notification:allow-is-permission-granted",
"notification:allow-request-permission",
"notification:allow-notify",
"updater:default",
{
"identifier": "http:default",
Expand Down
17 changes: 14 additions & 3 deletions src-tauri/src/commands/claude/cli_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl Drop for ClaudeProcessState {
if let Ok(handle) = tokio::runtime::Handle::try_current() {
// We're in a tokio runtime context
handle.block_on(async move {
// FIXME(perf): 持锁跨 await 易死锁,建议先 drop guard 再 await
let mut current_process = process.lock().await;
if let Some(mut child) = current_process.take() {
log::info!("Cleanup on drop: Killing Claude process");
Expand All @@ -58,6 +59,7 @@ impl Drop for ClaudeProcessState {
// Create a temporary runtime for cleanup
if let Ok(rt) = tokio::runtime::Runtime::new() {
rt.block_on(async move {
// FIXME(perf): 持锁跨 await 易死锁,建议先 drop guard 再 await
let mut current_process = process.lock().await;
if let Some(mut child) = current_process.take() {
log::info!("Cleanup on drop: Killing Claude process");
Expand Down Expand Up @@ -567,6 +569,7 @@ pub async fn cancel_claude_execution(
// Method 2: Try the legacy approach via ClaudeProcessState
if !killed {
let claude_state = app.state::<ClaudeProcessState>();
// FIXME(perf): 持锁跨 await 易死锁,建议先 drop guard 再 await
let mut current_process = claude_state.current_process.lock().await;

if let Some(mut child) = current_process.take() {
Expand Down Expand Up @@ -727,9 +730,17 @@ async fn spawn_claude_process(

// 使用 spawn 异步写入 stdin,避免阻塞主流程
tokio::spawn(async move {
if let Err(e) = stdin.write_all(prompt_for_stdin.as_bytes()).await {
log::error!("Failed to write prompt to stdin: {}", e);
return;
match stdin.write_all(prompt_for_stdin.as_bytes()).await {
Ok(()) => {}
Err(e) if e.kind() == std::io::ErrorKind::BrokenPipe => {
log::warn!("stdin BrokenPipe: child process exited before prompt was fully written");
// 进程已退出,不再传播错误,让 wait() 的退出码决定
return;
}
Err(e) => {
log::error!("Failed to write prompt to stdin: {}", e);
return;
}
}
// 关闭 stdin 表示输入完成
if let Err(e) = stdin.shutdown().await {
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/commands/claude/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ pub async fn save_claude_settings(settings: serde_json::Value) -> Result<String,
Ok("Settings saved successfully".to_string())
}

/// Updates the thinking mode in settings.json using Claude 4.6 Adaptive Thinking
/// Updates the thinking mode in settings.json using Claude 4.7 Adaptive Thinking
/// Sets CLAUDE_CODE_THINKING_EFFORT env var and cleans up legacy MAX_THINKING_TOKENS
#[tauri::command]
pub async fn update_thinking_mode(enabled: bool, effort: Option<String>) -> Result<String, String> {
Expand Down Expand Up @@ -425,7 +425,7 @@ pub async fn update_thinking_mode(enabled: bool, effort: Option<String>) -> Resu
.as_object_mut()
.ok_or("env is not an object")?;

// Update CLAUDE_CODE_THINKING_EFFORT (Claude 4.6 Adaptive Thinking)
// Update CLAUDE_CODE_THINKING_EFFORT (Claude 4.7 Adaptive Thinking)
if enabled {
let effort_value = effort.unwrap_or_else(|| "high".to_string());
env_obj.insert(
Expand Down
Loading