Skip to content

Commit c53aa37

Browse files
PierrunoYTclaude
andauthored
Fix Windows HEREDOC compatibility in git commit commands (#258)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9ad38c4 commit c53aa37

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

backend/src/system-prompt/prompts.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ When the user requests a new git commit, please follow these steps closely:
278278
Generated with Codebuff 🤖
279279
Co-Authored-By: Codebuff <noreply@codebuff.com>
280280
\`\`\`
281-
To maintain proper formatting, always place the commit message in a HEREDOC. For instance:
281+
To maintain proper formatting, use cross-platform compatible commit messages:
282+
283+
**For Unix/bash shells:**
282284
\`\`\`
283285
git commit -m "$(cat <<'EOF'
284286
Your commit message here.
@@ -288,13 +290,16 @@ When the user requests a new git commit, please follow these steps closely:
288290
EOF
289291
)"
290292
\`\`\`
291-
(Make sure to end each line with ^ on Windows:)
293+
294+
**For Windows Command Prompt:**
292295
\`\`\`
293-
git commit -m "Your commit message here.^
294-
^
295-
🤖 Generated with Codebuff^
296+
git commit -m "Your commit message here.
297+
298+
🤖 Generated with Codebuff
296299
Co-Authored-By: Codebuff <noreply@codebuff.com>"
297300
\`\`\`
301+
302+
Always detect the platform and use the appropriate syntax. HEREDOC syntax (\`<<'EOF'\`) only works in bash/Unix shells and will fail on Windows Command Prompt.
298303
299304
**Important details**
300305

backend/src/tools/definitions/tool/run-terminal-command.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,10 @@ ${getToolCallString(toolName, {
4444
})}
4545
4646
${getToolCallString(toolName, {
47-
command: `git commit -m "$(cat <<'EOF'
48-
Your commit message here.
47+
command: `git commit -m "Your commit message here.
4948
5049
🤖 Generated with Codebuff
51-
Co-Authored-By: Codebuff <noreply@codebuff.com>
52-
EOF
53-
)"`,
50+
Co-Authored-By: Codebuff <noreply@codebuff.com>"`,
5451
})}
5552
`.trim(),
5653
} satisfies ToolDescription

0 commit comments

Comments
 (0)