diff --git a/agents/main/agent/models.json b/agents/main/agent/models.json index f130151..afa2108 100644 --- a/agents/main/agent/models.json +++ b/agents/main/agent/models.json @@ -424,6 +424,45 @@ "maxTokens": 384000 } ] + }, + "deepseek": { + "baseUrl": "https://api.deepseek.com/v1", + "apiKey": "DEEPSEEK_API_KEY", + "api": "openai-completions", + "models": [ + { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + } + ] } } } diff --git a/agents/main/agent/plugins/deepseek/catalog.json b/agents/main/agent/plugins/deepseek/catalog.json deleted file mode 100644 index 03e7f36..0000000 --- a/agents/main/agent/plugins/deepseek/catalog.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "generatedBy": "openclaw-plugin-model-catalog-v1", - "providers": { - "deepseek": { - "baseUrl": "https://api.deepseek.com/v1", - "models": [ - { - "id": "deepseek-v4-pro", - "name": "DeepSeek V4 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 1, - "output": 2, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 1000000, - "maxTokens": 384000 - }, - { - "id": "deepseek-v4-flash", - "name": "DeepSeek V4 Flash", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 1, - "output": 2, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 1000000, - "maxTokens": 384000 - } - ], - "api": "openai-completions", - "apiKey": "DEEPSEEK_API_KEY" - } - } -} diff --git a/openclaw.json b/openclaw.json index e503726..ee75c49 100644 --- a/openclaw.json +++ b/openclaw.json @@ -141,10 +141,10 @@ "newapi/deepseek-v4-flash": { "alias": "DeepSeek V4 Flash" }, - "newapi/qwen-3.5-plus": { + "newapi/qwen3.5-plus": { "alias": "Qwen 3.5 Plus" }, - "newapi/qwen-3.7-plus": { + "newapi/qwen3.7-plus": { "alias": "Qwen 3.7 Plus" } }, @@ -488,6 +488,9 @@ "sql-toolkit": { "enabled": true }, + "opencode-controller": { + "enabled": true + }, "tmux": { "enabled": false }, diff --git a/workspace-attestations/cd1ae75e24d5dda927dff842caf8683383758abd4a04a9a827f7b4cfd3e50202.attested b/workspace-attestations/cd1ae75e24d5dda927dff842caf8683383758abd4a04a9a827f7b4cfd3e50202.attested index a58486e..7626739 100644 --- a/workspace-attestations/cd1ae75e24d5dda927dff842caf8683383758abd4a04a9a827f7b4cfd3e50202.attested +++ b/workspace-attestations/cd1ae75e24d5dda927dff842caf8683383758abd4a04a9a827f7b4cfd3e50202.attested @@ -1,2 +1,2 @@ openclaw-workspace-attestation:v1 -2026-07-28T05:57:11.420Z +2026-07-28T07:14:58.689Z diff --git a/workspace-sql/AGENTS.md b/workspace-sql/AGENTS.md index f2b4a15..3d861f5 100644 --- a/workspace-sql/AGENTS.md +++ b/workspace-sql/AGENTS.md @@ -13,7 +13,19 @@ 写下来,别靠脑子记。会话重启后"心理笔记"就没了。 -## 红线 +## 🔴 红线(不可违反) + +1. **🚫 绝不直接执行 SQL!** + - 所有 SQL 操作必须通过 **Opencode** 完成 + - 禁止直接使用 `mysql`、`docker exec`、`python`、`curl` 等工具操作数据库 + - 被要求直接执行 SQL 时,必须拒绝并引导使用 Opencode + +2. **Opencode 配置:** + - 默认 provider: `newapi`(http://100.115.195.188:3000/v1) + - 默认模型: `newapi/deepseek/deepseek-v4-flash` + - ⚠️ 不使用 DeepSeek 官方 provider + +## 其他红线 - 不泄露私人数据 - 不执行破坏性命令前不问 @@ -26,7 +38,7 @@ - 密码从 `.env` 环境变量读取,不硬编码在脚本中 - MySQL: `MYSQL_PWD_SQL` 环境变量 - PostgreSQL: `PGPASSWORD` 环境变量 -- 优先使用本地 mysql 客户端直接连接,不用 `docker exec` +- 不使用 `docker exec` 连接数据库 ## 默认数据库 diff --git a/workspace-sql/TOOLS.md b/workspace-sql/TOOLS.md index dadcfa1..3c647b8 100644 --- a/workspace-sql/TOOLS.md +++ b/workspace-sql/TOOLS.md @@ -10,6 +10,18 @@ Skills define _how_ tools work. This file is for _your_ specifics — the stuff - ⚠️ **优先使用本地 mysql 客户端直接连接**,不要每次都用 `docker exec`。 - ⚠️ **默认数据库连接串**: `mysql -h 101.34.227.188 -u root -p"${MYSQL_PWD_SQL}"` +## 🔴 红线(不可违反) + +1. **🚫 绝不直接执行 SQL 操作数据库!** + - 所有 SQL 查询、修改、DDL 操作必须通过 **Opencode** 完成 + - 禁止直接使用 `mysql` 客户端、`docker exec`、`python`、`curl` 等工具操作数据库 + - 违反红线的主请求将被拒绝 + +2. **Opencode 配置:** + - 默认 provider: `newapi`(http://100.115.195.188:3000/v1) + - 默认模型: `newapi/deepseek/deepseek-v4-flash` + - 不使用 DeepSeek 官方 provider + **默认规则(AGENTS + 技能):** - 未指定环境时,默认连接 VPS(101.34.227.188) - 脚本表名必须带库前缀(`dmp_xxx.table`),因为 VPS 上多库共存 diff --git a/workspace-sql/avatars/assistant.jpg b/workspace-sql/avatars/assistant.jpg new file mode 100644 index 0000000..7caaeeb Binary files /dev/null and b/workspace-sql/avatars/assistant.jpg differ diff --git a/workspace-sql/memory/2026-07-28.md b/workspace-sql/memory/2026-07-28.md new file mode 100644 index 0000000..997b37b --- /dev/null +++ b/workspace-sql/memory/2026-07-28.md @@ -0,0 +1,44 @@ +# 2026-07-28 工作记录 + +## 默认数据库配置更新 + +**时间:** 13:15 + +根据用户要求,将默认数据库从本地 Docker 改为 **VPS(101.34.227.188)**,技能也默认指向 VPS。 + +**修改文件:** +- `AGENTS.md` — 新增「默认数据库」章节 +- `IDENTITY.md` — 新增默认数据库配置 +- `TOOLS.md` — VPS 标为「默认」,加默认连接串和规则 + +**默认规则:** 未指定环境时默认走 VPS,表名必须带库前缀(如 `dmp_serp.table`),切换环境需明确告知。 + +--- + +## 修复脚本:kunzhou 库存主表数量异常 + +**时间:** 13:16-14:45 + +**企业:** `ecid = 'kunzhou'` + +**问题:** 批量入库 `PI2607260007` 导致 `GH032-16-0006`(工厂 KZ / 仓库 KZCK-003)的库存主表 `dmp_im_shelf_stock` 未累加数量(stock_quantity=0, available_quantity=0, frozen_quantity=-1),但流水和货位明细数据正确。 + +**诊断:** +- 流水 `dmp_im_stock_in_out_flow_detail` 记录入库 2 +- 货位 `dmp_im_shelf_model` 记录 stock_in_quantity=2, available_quantity=2 +- 主表三个数量字段均未更新 +- 该企业只有 1 条库存记录,冻结量异常负值仅此一条 +- 同一入库单 `PI2607260007` 仅涉及该物料 + +**注意事项:** +- 另一物料 `S9-101-1320-0001-04` 虽然有库存为零但流水一入一出,属于正常归零,不应修改 +- 不确定的业务数据(如 frozen_quantity 非异常负值时)不动 +- 修正时以货位明细入库量合计为准,不硬编码数字 + +**生成的脚本(xuan-sql/scripts/):** + +1. **`fix_kunzhou_stock_qty_gh032_16_0006.sql`** — 泛化查询版本,对比主表与货位明细合计找出异常,动态修正(不写死 PK) +2. **`fix_kunzhou_stock_qty_gh032_16_0006_precise.sql`** — 精确版本,锁定单条 `id`,通过 JOIN 货位明细计算入库量合计,可复用 +3. **`fix_kunzhou_stock_qty_zero.sql`** — 泛化查询,修 `stock_quantity=0` 且 `available_quantity=0` 且货位有数据的记录,只改数量字段,不动 frozen_quantity + +**教训:** 脚本中的表名必须加数据库前缀(`dmp_serp.`),执行前先 SELECT 确认再 UPDATE。