Claude prompt: only prepend on first turn

This commit is contained in:
Peter Steinberger
2025-11-27 03:53:13 +01:00
parent 8d995a8529
commit 9e6ad97cfb
2 changed files with 26 additions and 1 deletions

View File

@@ -179,7 +179,9 @@ export async function runCommandReply(
let finalArgv = argv;
const isClaudeInvocation =
finalArgv.length > 0 && path.basename(finalArgv[0]) === CLAUDE_BIN;
if (isClaudeInvocation && finalArgv.length > 0) {
const shouldPrependIdentity =
isClaudeInvocation && !(sendSystemOnce && systemSent);
if (shouldPrependIdentity && finalArgv.length > 0) {
const bodyIdx = finalArgv.length - 1;
const existingBody = finalArgv[bodyIdx] ?? "";
finalArgv = [