fix(chat): restore ~/.agents/skills/ as additional Codex skill dir

Codex CLI also reads skills from ~/.agents/skills/, so include it
alongside ~/.codex/skills/ in the skill storage spec. The Codex dir
stays first so it remains the preferred write target for new links,
while lookup and unlink scan both locations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xintaofei
2026-04-11 09:49:33 +08:00
parent 18887d77cb
commit 1bb8624160
2 changed files with 7 additions and 3 deletions

View File

@@ -1213,8 +1213,11 @@ pub(crate) fn skill_storage_spec(agent_type: AgentType) -> Option<SkillStorageSp
}),
AgentType::Codex => Some(SkillStorageSpec {
kind: SkillStorageKind::SkillDirectoryOrMarkdownFile,
global_dirs: vec![codex_home_dir().join("skills")],
project_rel_dirs: vec![".codex/skills"],
global_dirs: vec![
codex_home_dir().join("skills"),
home_dir_or_default().join(".agents").join("skills"),
],
project_rel_dirs: vec![".codex/skills", ".agents/skills"],
}),
AgentType::OpenCode => Some(SkillStorageSpec {
kind: SkillStorageKind::SkillDirectoryOnly,

View File

@@ -851,7 +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.
// Scan ALL global dirs for this agent to handle shared-dir agents
// (Codex, Gemini and Cline all also point at `~/.agents/skills/`).
// Remove the link wherever it is found.
let dirs = scoped_skill_dirs(agent_type, AgentSkillScope::Global, None)
.map_err(|_| ExpertsError::UnsupportedAgent(agent_type))?;