From 19979d50d0179bab6bde4e426a75bc2e6fbab25d Mon Sep 17 00:00:00 2001 From: xintaofei Date: Sat, 11 Apr 2026 00:37:31 +0800 Subject: [PATCH] fix(chat): use ~/.codex/skills/ for Codex expert symlinks and keep expert button always enabled Change Codex skill storage to use only ~/.codex/skills/ instead of ~/.agents/skills/, and never disable the expert skills button so users can always access the empty-state hint. Also fix stale expert list in conversation window after linking in the separate settings window by re-fetching on window focus. Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/src/commands/acp.rs | 7 +--- src-tauri/src/commands/experts.rs | 5 +-- src/components/chat/message-input.tsx | 2 +- src/hooks/use-agent-experts.ts | 60 +++++++++++++++++---------- 4 files changed, 44 insertions(+), 30 deletions(-) diff --git a/src-tauri/src/commands/acp.rs b/src-tauri/src/commands/acp.rs index feeb072..6e4e4f0 100644 --- a/src-tauri/src/commands/acp.rs +++ b/src-tauri/src/commands/acp.rs @@ -1213,11 +1213,8 @@ pub(crate) fn skill_storage_spec(agent_type: AgentType) -> Option Some(SkillStorageSpec { kind: SkillStorageKind::SkillDirectoryOrMarkdownFile, - global_dirs: vec![ - home_dir_or_default().join(".agents").join("skills"), - codex_home_dir().join("skills"), - ], - project_rel_dirs: vec![".agents/skills", ".codex/skills"], + global_dirs: vec![codex_home_dir().join("skills")], + project_rel_dirs: vec![".codex/skills"], }), AgentType::OpenCode => Some(SkillStorageSpec { kind: SkillStorageKind::SkillDirectoryOnly, diff --git a/src-tauri/src/commands/experts.rs b/src-tauri/src/commands/experts.rs index bdfb040..f2afb49 100644 --- a/src-tauri/src/commands/experts.rs +++ b/src-tauri/src/commands/experts.rs @@ -851,9 +851,8 @@ pub async fn experts_unlink_from_agent( let _guard = mutation_lock().lock().await; - // Scan ALL global dirs for this agent to handle shared-dir agents - // (Codex and Cline both point at `~/.agents/skills/`). Remove the - // link wherever it is found. + // Scan ALL global dirs for this agent to handle shared-dir agents. + // Remove the link wherever it is found. let dirs = scoped_skill_dirs(agent_type, AgentSkillScope::Global, None) .map_err(|_| ExpertsError::UnsupportedAgent(agent_type))?; diff --git a/src/components/chat/message-input.tsx b/src/components/chat/message-input.tsx index a3e04e1..46a8a9b 100644 --- a/src/components/chat/message-input.tsx +++ b/src/components/chat/message-input.tsx @@ -1757,7 +1757,7 @@ export function MessageInput({