From 30bdb499581d1f273685fafcea8b714fae4c1bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AB=E6=88=91=E5=B0=8F=E6=9D=A8=E5=90=8C=E5=AD=A6?= Date: Fri, 18 Sep 2026 22:59:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AC=AC=E4=B8=80=E8=BD=AE=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E5=90=8E=E4=B8=8D=E5=86=8D=E9=92=89=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E8=BD=AE=E6=95=B4=E6=AE=B5=E7=B3=BB=E7=BB=9F=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=20(#25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- README.md | 1 + README.zh-CN.md | 1 + lib/identity.js | 6 ------ lib/index.js | 3 --- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2c60d91..478bfef 100644 --- a/README.md +++ b/README.md @@ -615,6 +615,7 @@ If nothing is found, set `DSH_BASE` / `DSH_DESKTOP_INSTALL`. No files are change ### 1.1.7 +- **#25:** After the first turn, do not pin the previous full system prompt. Inject `prompt-inject.md` once; later turns leave this turn’s other sections as assembled. - **#26:** `dsh plugin add` / in-app update use GitHub `master.tar.gz`. A `.zip` URL is not a pnpm tarball (`ERR_PNPM_TARBALL_DECODE_GZIP`). Local overlay still downloads the zip for `tar` / Expand-Archive. - Install docs split **Web / Desktop** defaults: Web uses official `dsh --profile web`; Desktop uses the built-in terminal `dsh plugin add `. - Desktop Apply / Restart / Uninstall only touch the running desktop install tree, not official Web / npm-global. diff --git a/README.zh-CN.md b/README.zh-CN.md index 09f3d81..55ad1db 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -602,6 +602,7 @@ prompt-inject.md 有内容? ──是──> 原样写入 dsh-purge systemPrompt ### 1.1.7 +- **#25:** 第一轮注入 `prompt-inject.md` 之后不再把上一轮整段系统提示钉回去;后续只保留本轮组装结果。 - **#26:** `dsh plugin add` / 插件内更新改用 GitHub `master.tar.gz`。`.zip` 不是 pnpm tarball,会报 `ERR_PNPM_TARBALL_DECODE_GZIP`。本地覆盖安装仍下载 zip 给 `tar` / Expand-Archive。 - 安装文档按 **Web 端 / 桌面端** 分开写默认命令:Web 用官方 `dsh --profile web`;桌面端默认在自带终端 `dsh plugin add `。 diff --git a/lib/identity.js b/lib/identity.js index ba189d8..3df1980 100644 --- a/lib/identity.js +++ b/lib/identity.js @@ -188,14 +188,12 @@ function normalizeRewriteOptions(fallbackInject, options) { fallbackInject: typeof fallbackInject.fallbackInject === "string" ? fallbackInject.fallbackInject : "", dropMnemon: fallbackInject.dropMnemon !== false, dropPurgeAfterFold: fallbackInject.dropPurgeAfterFold !== false, - pinPersonaText: typeof fallbackInject.pinPersonaText === "string" ? fallbackInject.pinPersonaText : "", }; } return { fallbackInject: typeof fallbackInject === "string" ? fallbackInject : "", dropMnemon: options?.dropMnemon !== false, dropPurgeAfterFold: options?.dropPurgeAfterFold !== false, - pinPersonaText: typeof options?.pinPersonaText === "string" ? options.pinPersonaText : "", }; } @@ -224,10 +222,6 @@ function foldInjectIntoPersona(sections, injectText) { export function rewritePromptAssembly(assembled, fallbackInject = "", options = {}) { if (!assembled || !Array.isArray(assembled.sections)) return assembled; const opts = normalizeRewriteOptions(fallbackInject, options); - if (opts.pinPersonaText) { - assembled.sections = [{ name: "deployment:persona-prefix", text: opts.pinPersonaText }]; - return assembled; - } const rest = []; const purge = []; for (const section of assembled.sections) { diff --git a/lib/index.js b/lib/index.js index 673c1c5..1c7ed55 100644 --- a/lib/index.js +++ b/lib/index.js @@ -7,7 +7,6 @@ import * as rules from "./rules.js"; import * as updater from "./update.js"; import { GLOBAL_PROMPT_ORDER, - existingSystemPrompt, isMnemonPluginMessage, rewritePromptAssembly, shouldInjectPrompt, @@ -209,14 +208,12 @@ function installIdentityOverride(ctx, config = {}) { const hook = async (_assembly, context, next) => { const inject = config.enabled === false ? "" : readInjectFallback(); const allow = config.enabled !== false && shouldInjectPrompt(context, config.injectOnce !== false, inject); - const pin = !allow && existingSystemPrompt(context); return assembleState.run({ allow }, async () => { const assembled = typeof next === "function" ? await next() : _assembly; return rewritePromptAssembly(assembled, { fallbackInject: allow ? inject : "", dropMnemon: config.stripMnemon !== false, dropPurgeAfterFold: true, - pinPersonaText: pin, }); }); };