Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions apps/desktop/src/main/todo-agent/supervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 のルートです。`,
);
Expand Down
Loading