diff --git a/docs/knowledge/index.mdx b/docs/knowledge/index.mdx
index b4cf7f9b..4f9aa797 100644
--- a/docs/knowledge/index.mdx
+++ b/docs/knowledge/index.mdx
@@ -5,6 +5,10 @@ description: CowAgent 的个人知识库系统 — 结构化知识沉淀、自
个人知识库是 Agent 的长期结构化知识存储,保存在工作空间的 `knowledge/` 目录下。与按时间线组织的记忆不同,知识库以主题为维度,将用户分享的文章、对话中的洞察、学习材料等整理为互相关联的 Markdown 页面,形成可持续增长的知识网络。
+
+
+
+
## 核心概念
### 知识 vs 记忆
@@ -30,7 +34,12 @@ description: CowAgent 的个人知识库系统 — 结构化知识沉淀、自
└── llm-wiki.md
```
-目录结构是灵活的 — Agent 会根据实际内容自动创建合适的分类目录。用户也可以通过对话自定义目录组织方式。
+目录结构是灵活的 — Agent 会根据实际内容自动创建合适的分类目录。用户也可以通过对话的方式自定义目录组织方式。
+
+
+
+
+
## 自动整理
@@ -40,6 +49,11 @@ description: CowAgent 的个人知识库系统 — 结构化知识沉淀、自
- **对话产生有价值的结论** — Agent 将洞察整理为知识页面,并与已有知识建立关联
- **用户主动要求整理** — 用户可以通过对话指导 Agent 组织和更新知识
+
+
+
+
+
每个知识页面都包含与其他页面的交叉引用链接,逐步构建起一个知识图谱。
## 知识检索
@@ -55,9 +69,14 @@ Agent 在对话中可以通过以下方式检索知识:
Web 控制台提供了专用的「知识」模块,支持:
- **文档浏览** — 树状目录结构,可搜索、可折叠,点击查看文档内容
-- **知识图谱** — 基于 D3.js 的力导向图,可视化展示知识之间的关联关系
+- **知识图谱** — 可视化展示知识之间的关联关系,节点可直接跳转至文档
- **对话联动** — Agent 回复中引用的知识文档链接可直接点击跳转查看
+
+
+
+
+
## CLI 命令
通过 `/knowledge` 命令管理知识库:
diff --git a/models/claudeapi/claude_api_bot.py b/models/claudeapi/claude_api_bot.py
index 49fc3d46..05a7b567 100644
--- a/models/claudeapi/claude_api_bot.py
+++ b/models/claudeapi/claude_api_bot.py
@@ -323,7 +323,7 @@ class ClaudeAPIBot(Bot, OpenAIImage):
if msg.get("role") == "system":
system_prompt = msg["content"]
else:
- claude_messages.append(msg)
+ claude_messages.append(self._sanitize_message(msg))
request_params = {
"model": actual_model,
@@ -363,6 +363,30 @@ class ClaudeAPIBot(Bot, OpenAIImage):
"status_code": 500
}
+ @staticmethod
+ def _sanitize_message(msg: dict) -> dict:
+ """Strip thinking blocks without a ``signature`` from assistant messages.
+
+ When the session switches from another model (e.g. MiniMax) to Claude,
+ the in-memory history may contain thinking blocks that lack the
+ ``signature`` field required by the Anthropic API, causing 400 errors.
+ We create a shallow copy so the original history is not mutated.
+ """
+ if msg.get("role") != "assistant":
+ return msg
+ content = msg.get("content")
+ if not isinstance(content, list):
+ return msg
+ cleaned = [
+ block for block in content
+ if not (isinstance(block, dict)
+ and block.get("type") == "thinking"
+ and "signature" not in block)
+ ]
+ if len(cleaned) == len(content):
+ return msg
+ return {**msg, "content": cleaned}
+
def _handle_sync_response(self, request_params):
"""Handle synchronous Claude API response"""
# Prepare headers
diff --git a/run.sh b/run.sh
index 9a75f17a..74b09665 100755
--- a/run.sh
+++ b/run.sh
@@ -196,7 +196,7 @@ clone_project() {
# Test GitHub connectivity before attempting clone
if curl -sI --connect-timeout 5 --max-time 10 https://github.com > /dev/null 2>&1; then
echo -e "${YELLOW}🌐 GitHub is reachable, cloning from GitHub...${NC}"
- _timeout 15 git clone --depth 10 --progress https://github.com/zhayujie/CowAgent.git && clone_ok=true
+ _timeout 60 git clone --depth 10 --progress https://github.com/zhayujie/CowAgent.git && clone_ok=true
fi
if [ "$clone_ok" = false ]; then
echo -e "${YELLOW}⚠️ GitHub clone failed or timed out, switching to Gitee mirror...${NC}"