From 575a486211024ca5c62cba45cec900f18ac86e21 Mon Sep 17 00:00:00 2001 From: MemRelay Date: Wed, 11 Nov 2026 00:49:31 +0800 Subject: [PATCH] =?UTF-8?q?create:=20OpenCode=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D=E8=A6=81=E9=94=81=E6=AD=BB=20SQL=20?= =?UTF-8?q?=E5=92=8C=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MemRelay-Operation: memory-save:opencode-prompt-contract-20261111-1 MemRelay-Resource: a1c2c463-892d-4d3a-bafc-fa3edccb20d7 --- ...penCode 导出提示词要锁死 SQL 和绝对路径.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 projects/d5a7f581-c442-4554-87b9-ee723b8b0258/OpenCode 导出提示词要锁死 SQL 和绝对路径.md diff --git a/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/OpenCode 导出提示词要锁死 SQL 和绝对路径.md b/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/OpenCode 导出提示词要锁死 SQL 和绝对路径.md new file mode 100644 index 0000000..2a86561 --- /dev/null +++ b/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/OpenCode 导出提示词要锁死 SQL 和绝对路径.md @@ -0,0 +1,29 @@ +--- +title: OpenCode 导出提示词要锁死 SQL 和绝对路径 +type: experience +permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/open-code-导出提示词要锁死-sql-和绝对路径 +stable_id: a1c2c463-892d-4d3a-bafc-fa3edccb20d7 +scope: project +memory_type: experience +project_id: d5a7f581-c442-4554-87b9-ee723b8b0258 +usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 +status: active +revision: 1 +request_id: opencode-prompt-contract-20261111-1 +created_at: '2026-11-10T16:49:27.968106+00:00' +updated_at: '2026-11-10T16:49:27.968106+00:00' +tags: +- OpenCode +- 提示词 +- 工参 +- adhoc_query +--- + +## 做法 +给 OpenCode 的提示词一次只导出一个文件,并写死技能、SQL、绝对保存目录、文件名和结束行。程序不解析聊天正文,只认导出脚本打印的「文件已保存至」路径;等到 session.idle 后按该路径调用 file/content,再核对表头。 + +## 依据 +adhoc_query 技能默认不导出,只有提示词明确要求导出才调用 script/download-file-all-async.py。参数是 --sql 和 --save-dir,保存目录必须是绝对路径且不能是「.」。文件名要用 --filename 指定。超过 10 万行时技能会再向用户确认,单小区或单站点任务不会触发。 + +## 已验证 +nqi-agent.chlz 中按该方式要求 data/2026-11-09/4G小区工参.csv 和 5G小区工参.csv,模型最后原样输出了「本轮数据提取已完成,数据储存目录为./data/2026-11-09/下」,文件也按该路径取回。 \ No newline at end of file