From 0563588c7418c7b902f0668ba1abd0af37d80077 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Sat, 22 Aug 2026 19:12:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(chat):=20skill=20=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E9=80=82=E9=85=8D=E5=90=8E=E7=AB=AF=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端自 cedef87d 起 /api/skills 返回相对工作区路径(.astrion/skills/...), SKILL_MARKDOWN_LINK_RE 与 USER_SKILL_LINK_RE 的路径前缀改为可选,兼容历史绝对路径消息 --- static/src/app/methods/message/shared.ts | 3 ++- static/src/components/chat/ChatArea.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/static/src/app/methods/message/shared.ts b/static/src/app/methods/message/shared.ts index da3044a2..6933035f 100644 --- a/static/src/app/methods/message/shared.ts +++ b/static/src/app/methods/message/shared.ts @@ -4,7 +4,8 @@ import { debugLog } from '../common'; import { useModelStore } from '../../../stores/model'; // 兼容 Windows 反斜杠路径:skills 目录与 SKILL.md 前的分隔符同时接受 / 和 \ -export const SKILL_MARKDOWN_LINK_RE = /\[\$([^\]\n]+)\]\(([^)\n]*[\\/]\.astrion[\\/]skills[\\/][^)\n]+[\\/]SKILL\.md)\)/g; +// 路径前缀可选:后端自 cedef87d 起返回相对工作区路径(.astrion/skills/...),历史消息仍可能是绝对路径 +export const SKILL_MARKDOWN_LINK_RE = /\[\$([^\]\n]+)\]\(((?:[^)\n]*[\\/])?\.astrion[\\/]skills[\\/][^)\n]+[\\/]SKILL\.md)\)/g; export function extractSkillRefsFromMessage(message = '') { const refs = []; diff --git a/static/src/components/chat/ChatArea.vue b/static/src/components/chat/ChatArea.vue index 0e269eaa..15800440 100644 --- a/static/src/components/chat/ChatArea.vue +++ b/static/src/components/chat/ChatArea.vue @@ -1069,7 +1069,8 @@ const escapeUserHtml = (value: string): string => .replace(/'/g, '''); // 兼容 Windows 反斜杠路径:skills 目录与 SKILL.md 前的分隔符同时接受 / 和 \ -const USER_SKILL_LINK_RE = /\[\$([^\]\n]+)\]\(([^)\n]*[\\/]\.astrion[\\/]skills[\\/][^)\n]+[\\/]SKILL\.md)\)/g; +// 路径前缀可选:后端自 cedef87d 起返回相对工作区路径(.astrion/skills/...),历史消息仍可能是绝对路径 +const USER_SKILL_LINK_RE = /\[\$([^\]\n]+)\]\(((?:[^)\n]*[\\/])?\.astrion[\\/]skills[\\/][^)\n]+[\\/]SKILL\.md)\)/g; const USER_FILE_LINK_RE = /\[([^\]\n]+)\]\(file:\/\/([^)\n]+)\)/g; const SUB_AGENT_DONE_LABEL_RE = /^子智能体\d+\s*任务完成$/; const SUB_AGENT_DONE_PREFIX_RE = /^(?:✅\s*)?子智能体\s*#?\s*(\d+)\s*任务摘要[::]/;