Skip to content

Commit ef3bba5

Browse files
Fix format string escaping in execute_command tool documentation
Correct percent sign escaping in git log format strings within the tool documentation examples. The format specifiers need to be doubled (%%h, %%s, %%n, %%b) to properly render in fmt.Sprintf output. Co-authored-by: construct-agent <noreply@construct.sh>
1 parent b9b2019 commit ef3bba5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/tool/codeact/execute_command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ When the user asks you to create a new git commit, follow these steps carefully:
7171
2. **Analyze changes**: List modified files, categorize change type (feature/fix/refactor/docs/test)
7272
3. **Determine motivation**: Why were these changes made?
7373
4. **Security scan**: Check staged files for sensitive information
74-
5. **Check repository style**: Review recent commits (%[2]sgit log --format='%h - %s%n%b%n---' -6%[2]s) for message patterns
74+
5. **Check repository style**: Review recent commits (%[2]sgit log --format='%%h - %%s%%n%%b%%n---' -6%[2]s) for message patterns
7575
7676
### Commit Message Rules
7777
- Focus on "why" not "what" - explain purpose, not just actions
@@ -124,7 +124,7 @@ const gitDiffCached = execute_command("git diff --cached");
124124
print("=== CACHED DIFF ===");
125125
print(gitDiffCached.stdout);
126126
127-
const gitLog = execute_command("git log --format='%h - %s%n%b%n---' -6");
127+
const gitLog = execute_command("git log --format='%%h - %%s%%n%%b%%n---' -6");
128128
print("=== LAST 6 COMMITS ===");
129129
print(gitLog.stdout);
130130

0 commit comments

Comments
 (0)