From ddce25a2c600fd7857901f6c9bc0af956ceadf64 Mon Sep 17 00:00:00 2001 From: MocA-Love Date: Thu, 16 Apr 2026 07:12:02 +0900 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20TODO=E3=81=AE=E3=82=B7=E3=82=B9?= =?UTF-8?q?=E3=83=86=E3=83=A0=E3=83=97=E3=83=AD=E3=83=B3=E3=83=97=E3=83=88?= =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=81=8C?= =?UTF-8?q?=E5=8A=B9=E3=81=84=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --append-system-prompt 経由でプリセット内容を渡していたが、 ユーザーから 「Claude が読めていない気がする」 と報告されていた。 可視化とデリバリ保証の2方向で修正。 - 起動時 setup イベントに customSystemPrompt のプレビュー (先頭200文字) を表示してUIで確認できるようにした - iteration 1 の user プロンプト先頭にも同内容を 「ユーザー設定のシステム指示(最優先で遵守)」 として注入。 --append-system-prompt と重複してもClaudeは許容するので 確実に届くことを優先した Closes #190 --- .../desktop/src/main/todo-agent/supervisor.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/apps/desktop/src/main/todo-agent/supervisor.ts b/apps/desktop/src/main/todo-agent/supervisor.ts index eb7d866e7e2..d0347bf1c4a 100644 --- a/apps/desktop/src/main/todo-agent/supervisor.ts +++ b/apps/desktop/src/main/todo-agent/supervisor.ts @@ -227,6 +227,17 @@ class TodoSupervisor { "予算", `${session0.maxIterations} iter · ${Math.round(session0.maxWallClockSec / 60)} 分`, ); + if (session0.customSystemPrompt?.trim()) { + const preview = session0.customSystemPrompt + .trim() + .replace(/\s+/g, " ") + .slice(0, 200); + appendSetupEvent( + sessionId, + "システムプロンプト", + `${preview}${session0.customSystemPrompt.trim().length > 200 ? "…" : ""}`, + ); + } appendSetupEvent( sessionId, "Claude", @@ -703,6 +714,17 @@ function buildIterationPrompt(params: { const sections: string[] = []; if (iteration === 1) { + // Mirror the preset / custom system prompt into the first turn's + // user message. `--append-system-prompt` alone was not always + // visibly honored (users reported "気がする" that Claude never + // read the template). Duplicating it as explicit steering at the + // top of the prompt guarantees delivery and is cheap — Claude + // tolerates the same guidance appearing twice. + if (session.customSystemPrompt?.trim()) { + sections.push( + `ユーザー設定のシステム指示(最優先で遵守):\n${session.customSystemPrompt.trim()}`, + ); + } sections.push( `${goalPath} を読んで、${goalClause}。作業ディレクトリは worktree のルートです。`, );