feat: workspace volume in docker deploy

This commit is contained in:
zhayujie
2026-03-18 16:03:03 +08:00
parent 8993e8ad3e
commit c6384363f9
6 changed files with 77 additions and 17 deletions

View File

@@ -423,7 +423,7 @@ def _build_context_files_section(context_files: List[ContextFile], language: str
]
if has_agent:
lines.append("**`AGENT.md` 是你的灵魂文件**:严格体现其中定义的人格语气,避免僵硬、模板化的回复。")
lines.append("**`AGENT.md` 是你的灵魂文件**:严格体现其中定义的人格语气和设定,避免僵硬、模板化的回复。")
lines.append("当用户通过对话透露了对你性格、风格、职责、能力边界的新期望,你应该主动用 `edit` 更新 AGENT.md 以反映这些演变。")
lines.append("")

View File

@@ -25,11 +25,11 @@ WORKDIR ${BUILD_PREFIX}
ADD docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh \
&& mkdir -p /home/noroot \
&& groupadd -r noroot \
&& useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \
&& chown -R noroot:noroot /home/noroot ${BUILD_PREFIX} /usr/local/lib
&& mkdir -p /home/agent/cow \
&& groupadd -r agent \
&& useradd -r -g agent -s /bin/bash -d /home/agent agent \
&& chown -R agent:agent /home/agent ${BUILD_PREFIX} /usr/local/lib
USER noroot
USER agent
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -39,3 +39,5 @@ services:
AGENT_MAX_CONTEXT_TOKENS: 40000
AGENT_MAX_CONTEXT_TURNS: 20
AGENT_MAX_STEPS: 15
volumes:
- ./cow:/home/agent/cow

View File

@@ -59,7 +59,8 @@
"group": "安装部署",
"pages": [
"guide/quick-start",
"guide/manual-install"
"guide/manual-install",
"guide/upgrade"
]
}
]

52
docs/guide/upgrade.mdx Normal file
View File

@@ -0,0 +1,52 @@
---
title: 更新升级
description: CowAgent 的升级方式说明
---
## 脚本升级(推荐)
如果使用 `run.sh` 管理服务,执行以下命令即可一键升级:
```bash
./run.sh update
```
该命令会自动完成以下流程:
1. 停止当前运行的服务
2. 拉取最新代码
3. 重新检查依赖
4. 启动服务
## 手动升级
在项目根目录下执行:
```bash
git pull
pip3 install -r requirements.txt
```
更新完成后重启服务:
```bash
# 如果使用 run.sh 管理
./run.sh restart
# 如果使用 nohup 直接运行
kill $(ps -ef | grep app.py | grep -v grep | awk '{print $2}')
nohup python3 app.py & tail -f nohup.out
```
## Docker 升级
在 `docker-compose.yml` 所在目录下执行:
```bash
sudo docker compose pull
sudo docker compose up -d
```
<Tip>
升级前建议备份 `config.json` 配置文件。Docker 环境下如需保留数据,可通过 volume 挂载持久化工作空间目录。
</Tip>

View File

@@ -9,7 +9,7 @@ description: CowAgent 2.0.3 - 新增企微智能机器人和 QQ 通道、Web 控
新增企业微信智能机器人(`wecom_bot`)通道,支持流式卡片消息输出,支持文本和图片消息的接收与回复,可在 Web 控制台中进行通道配置和管理。
接入文档:[企微智能机器人接入](/channels/wecom-bot)。
接入文档:[企微智能机器人接入](https://docs.cowagent.ai/channels/wecom-bot)。
相关提交:[d4480b6](https://github.com/zhayujie/chatgpt-on-wechat/commit/d4480b6), [a42f31f](https://github.com/zhayujie/chatgpt-on-wechat/commit/a42f31f), [4ecd4df](https://github.com/zhayujie/chatgpt-on-wechat/commit/4ecd4df), [8b45d6c](https://github.com/zhayujie/chatgpt-on-wechat/commit/8b45d6c)
@@ -17,7 +17,7 @@ description: CowAgent 2.0.3 - 新增企微智能机器人和 QQ 通道、Web 控
新增 QQ 官方机器人(`qq`)通道,支持文本和图片消息的接收与回复,支持私聊和群聊场景。
接入文档参考: [QQ机器人接入](/channels/qq)。
接入文档参考:[QQ机器人接入](https://docs.cowagent.ai/channels/qq)。
相关提交:[005a0e1](https://github.com/zhayujie/chatgpt-on-wechat/commit/005a0e1), [a4d54f5](https://github.com/zhayujie/chatgpt-on-wechat/commit/a4d54f5)
@@ -36,11 +36,11 @@ Web 控制台对话界面支持文件和图片上传,可直接发送文件给
新增各厂商 Coding Plan编程包月套餐的接入支持通过 OpenAI 兼容方式统一接入。目前已支持阿里云、MiniMax、智谱 GLM、Kimi、火山引擎等厂商。
详细配置参考 [Coding Plan 文档](/models/coding-plan)。
详细配置参考 [Coding Plan 文档](https://docs.cowagent.ai/models/coding-plan)。
## 🧠 记忆系统升级
记忆冲刷Memory Flush系统全面升级:
记忆写入Memory Flush升级
- 使用 LLM 对超出上下文窗口的对话内容进行智能摘要,生成精炼的每日记忆条目
- 摘要在后台线程异步执行,不阻塞回复
@@ -60,6 +60,7 @@ Web 控制台对话界面支持文件和图片上传,可直接发送文件给
- **配置模板对齐**`docker-compose.yml` 环境变量与 `config-template.json` 对齐,补充完整的模型 API Key 和 Agent 等配置项
- **Web 控制台端口映射**:新增 `9899` 端口映射Docker 部署后可通过浏览器访问 Web 控制台
- **配置热更新**:各模型 Bot 的 API Key 和 API Base 改为实时读取,通过 Web 控制台修改配置后无需重启即可生效
- **工作空间持久化**:新增 `./cow` Volume 挂载Agent 工作空间数据(记忆、人格、技能等)持久化到宿主机,容器重建或升级不丢失
## ⚡ 性能优化
@@ -68,11 +69,11 @@ Web 控制台对话界面支持文件和图片上传,可直接发送文件给
## 🐛 问题修复
- **bot_type 配置**:修复 Agent 模式下 `bot_type` 配置传递问题 ([36d54ca](https://github.com/zhayujie/chatgpt-on-wechat/commit/36d54ca)) ([#2691](https://github.com/zhayujie/chatgpt-on-wechat/pull/2691)) Thanks [@Weikjssss](https://github.com/Weikjssss)
- **bot_type 优先级**:调整 Agent 模式下 `bot_type` 的解析优先级 ([d0a70d3](https://github.com/zhayujie/chatgpt-on-wechat/commit/d0a70d3)) ([#2692](https://github.com/zhayujie/chatgpt-on-wechat/pull/2692)) Thanks [@6vision](https://github.com/6vision)
- **智谱模型配置**:修复智谱 `bot_type` 命名、Web 控制台持久化及正则转义问题 ([c4a93b7](https://github.com/zhayujie/chatgpt-on-wechat/commit/c4a93b7)) ([#2693](https://github.com/zhayujie/chatgpt-on-wechat/pull/2693)) Thanks [@6vision](https://github.com/6vision)
- **OpenAI 兼容层**:使用 `openai_compat` 层统一错误处理 ([f1e888f](https://github.com/zhayujie/chatgpt-on-wechat/commit/f1e888f)) ([#2688](https://github.com/zhayujie/chatgpt-on-wechat/pull/2688)) Thanks [@JasonOA888](https://github.com/JasonOA888)
- **OpenAI 兼容迁移**:完成所有模型 Bot 的 `openai_compat` 迁移 ([d5d0b94](https://github.com/zhayujie/chatgpt-on-wechat/commit/d5d0b94)) ([#2689](https://github.com/zhayujie/chatgpt-on-wechat/pull/2689))
- **bot_type 配置**:修复 Agent 模式下 `bot_type` 配置传递问题 ([#2691](https://github.com/zhayujie/chatgpt-on-wechat/pull/2691)) Thanks [@Weikjssss](https://github.com/Weikjssss)
- **bot_type 优先级**:调整 Agent 模式下 `bot_type` 的解析优先级 ([#2692](https://github.com/zhayujie/chatgpt-on-wechat/pull/2692)) Thanks [@6vision](https://github.com/6vision)
- **智谱模型配置**:修复智谱 `bot_type` 命名、Web 控制台持久化及正则转义问题 ([#2693](https://github.com/zhayujie/chatgpt-on-wechat/pull/2693)) Thanks [@6vision](https://github.com/6vision)
- **OpenAI 兼容层**:使用 `openai_compat` 层统一错误处理 ([#2688](https://github.com/zhayujie/chatgpt-on-wechat/pull/2688)) Thanks [@JasonOA888](https://github.com/JasonOA888)
- **OpenAI 兼容迁移**:完成所有模型 Bot 的 `openai_compat` 迁移 ([#2689](https://github.com/zhayujie/chatgpt-on-wechat/pull/2689))
- **Gemini 工具调用**:修复 Gemini 模型的工具调用匹配问题 ([eda82ba](https://github.com/zhayujie/chatgpt-on-wechat/commit/eda82ba))
- **会话并发**:修复会话并发场景下的竞态条件问题 ([9879878](https://github.com/zhayujie/chatgpt-on-wechat/commit/9879878))
- **历史消息恢复**:修复历史会话消息不完整问题,仅恢复 user/assistant 文本消息,剥离工具调用 ([b788a3d](https://github.com/zhayujie/chatgpt-on-wechat/commit/b788a3d), [a33ce97](https://github.com/zhayujie/chatgpt-on-wechat/commit/a33ce97))
@@ -80,7 +81,11 @@ Web 控制台对话界面支持文件和图片上传,可直接发送文件给
- **Safari 兼容**:修复 Safari 浏览器 IME 回车键误触发消息发送问题 ([0687916](https://github.com/zhayujie/chatgpt-on-wechat/commit/0687916))
- **Windows 兼容**:修复 Windows 下 bash 风格 `$VAR` 环境变量转换为 `%VAR%` 的问题 ([7c67513](https://github.com/zhayujie/chatgpt-on-wechat/commit/7c67513))
- **MiniMax 参数**:增加 MiniMax 模型的 `max_tokens` 限制 ([1767413](https://github.com/zhayujie/chatgpt-on-wechat/commit/1767413))
- **.gitignore 更新**:添加 Python 目录忽略规则 ([9318138](https://github.com/zhayujie/chatgpt-on-wechat/commit/9318138)) ([#2683](https://github.com/zhayujie/chatgpt-on-wechat/pull/2683)) Thanks [@pelioo](https://github.com/pelioo)
- **.gitignore 更新**:添加 Python 目录忽略规则 ([#2683](https://github.com/zhayujie/chatgpt-on-wechat/pull/2683)) Thanks [@pelioo](https://github.com/pelioo)
- **AGENT.md 主动演进**:优化系统提示词中对 AGENT.md 的更新引导,从被动的"用户修改时更新"改为主动识别对话中的性格、风格变化并自动更新
## 📦 升级方式
源码部署可执行 `./run.sh update` 一键升级,或手动拉取代码后重启。详见 [更新升级文档](https://docs.cowagent.ai/guide/upgrade)。
**发布日期**2026.03.18 | [Full Changelog](https://github.com/zhayujie/chatgpt-on-wechat/compare/2.0.2...master)