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*任务摘要[::]/;