Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Restore agent slash skill suggestions https://github.com/siyuan-note/siyuan/issues/19316

Daniel6321cc15b370
diff --git a/app/src/layout/dock/agent/AgentComposer.ts b/app/src/layout/dock/agent/AgentComposer.ts
index 54efee60be..7d3258766f 100644
--- a/app/src/layout/dock/agent/AgentComposer.ts
+++ b/app/src/layout/dock/agent/AgentComposer.ts
@@ -80,6 +80,8 @@ const hintSkill = (key: string, protyle: IProtyle): IHintData[] => {
return [];
}
prepareAgentHint(protyle);
+ // 每次查询都切换到加载状态,避免已有候选项让异步占位结果关闭菜单。
+ protyle.hint.genHTML([], protyle, true, "hint");
protyle.hint.genLoading(protyle);
fetchPost("/api/ai/agent/lsSkills", {}, (response) => {
// 异步响应返回时输入状态可能已变化,避免 Esc 或其他提示触发后重新打开旧菜单。
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index 41c83ad0e1..5b259c3075 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -324,7 +324,7 @@ export class Hint {
if (protyle.lite) {
protyle.options.hint.extend.find((item) => {
if (item.key === "/" && item.hint) {
- this.genHTML(item.hint(key, protyle, "hint"), protyle, true, "hint");
+ this.genHTML(item.hint(key, protyle, "hint"), protyle, false, "hint");
return true;
}
});