Skip to content

Commit 956f77f

Browse files
committed
fix(prompts): remove stray tab before Tool Use Guidelines heading (#1415)
The system prompt template indented getToolUseGuidelinesSection() with a leading tab, so every request sent a tab-prefixed "# Tool Use Guidelines" heading instead of the column-0 heading used by every other section. Drop the tab, pin the heading position with a regression assertion, and refresh the six file snapshots that embedded the old prompt (two of them orphaned by earlier refactors but still tracked).
1 parent b55ff87 commit 956f77f

10 files changed

Lines changed: 14 additions & 9 deletions

‎src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/add-custom-instructions/no-mcp-servers.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/system-prompt/with-different-viewport-size.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/__snapshots__/system-prompt/with-undefined-mcp-hub.snap‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core/prompts/__tests__/system-prompt.spec.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,11 @@ describe("SYSTEM_PROMPT", () => {
560560
// Should contain Tool Use Guidelines section
561561
expect(prompt).toContain("Tool Use Guidelines")
562562

563+
// The guidelines heading must start at column 0. A stray leading tab
564+
// (#1415) would otherwise be sent to the model with every request.
565+
expect(prompt).toContain("\n# Tool Use Guidelines\n")
566+
expect(prompt).not.toContain("\t# Tool Use Guidelines")
567+
563568
// Should NOT contain a tool catalog / XML examples
564569
expect(prompt).not.toContain("# Tools")
565570
expect(prompt).not.toContain("## read_file")

‎src/core/prompts/system.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ${markdownFormattingSection()}
9898
9999
${getSharedToolUseSection()}${toolsCatalog}
100100
101-
${getToolUseGuidelinesSection()}
101+
${getToolUseGuidelinesSection()}
102102
103103
${
104104
// Forward the hub only when the mode actually exposes the MCP group, and pass the per-mode

0 commit comments

Comments
 (0)