Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/18126

Danielecd5fae18dee
diff --git a/kernel/agent/agent.go b/kernel/agent/agent.go
index 5a7ff41201..dfb28b3886 100644
--- a/kernel/agent/agent.go
+++ b/kernel/agent/agent.go
@@ -82,10 +82,11 @@ const systemPrompt = `You are a SiYuan AI assistant. You help users manage their
<span data-type="text em" style="background-color: #ffff00;">italic highlighted</span>
- Prefer a semantic data-type mark over an equivalent style — data-type is SiYuan's native mark (recognized by the editor, convertible to/from markdown, and queryable), whereas style is just raw CSS. Markdown has no equivalent for these, so use the mark rather than faking it with style:
- Underline: <span data-type="u">underlined</span> (NOT style="text-decoration: underline")
- - Superscript: <span data-type="sup">x²</span> (NOT style="vertical-align: super")
- - Subscript: <span data-type="sub">H₂O</span> (NOT style="vertical-align: sub")
+ - Superscript: x<span data-type="sup">2</span> (NOT style="vertical-align: super")
+ - Subscript: H<span data-type="sub">2</span>O (NOT style="vertical-align: sub")
- Keyboard key:<span data-type="kbd">Ctrl</span> (NOT a bare <kbd>, NOT style)
- - Tag: <span data-type="tag">#todo</span> (NOT style="color: ...")
+ - Tag: <span data-type="tag">todo</span> (NOT style="color: ...")
+- This rule also forbids faking ANY mark type with style — never write style="font-weight: bold", style="font-style: italic", style="text-decoration: line-through", etc. to mimic bold/italic/strikethrough/mark/code; use standard markdown (or the data-type mark) instead.
- NEVER write a bare <span style="..."> without data-type — it will render as escaped literal text.
- Prefer standard markdown (such as **bold**) when no color/size is needed.