Skip to content

fix(prompts): remove stray tab before Tool Use Guidelines section - #1416

Open
daewoongoh wants to merge 1 commit into
Zoo-Code-Org:mainfrom
daewoongoh:fix/tool-use-section-indentation
Open

fix(prompts): remove stray tab before Tool Use Guidelines section#1416
daewoongoh wants to merge 1 commit into
Zoo-Code-Org:mainfrom
daewoongoh:fix/tool-use-section-indentation

Conversation

@daewoongoh

@daewoongoh daewoongoh commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #1415

Description

The Tool Use Guidelines sub-section inside the TOOL USE section of the system prompt had a leading tab character, so it was sent to the LLM indented, unlike every other section.

  • src/core/prompts/system.ts: removed the leading tab before ${getToolUseGuidelinesSection()} so it starts at the beginning of the line like the other sections.
  • Traced the history with git log -p -L and found the tab was leftover from a refactor: a single leading space was introduced in chore: remove XML tool calling support (#10841), then turned into a tab by Enable parallel tool calls by default (#11031). Neither commit intended this indentation, so it's not a deliberate format.
  • Updated the 3 snapshots whose expected value changed as a result: consistent-system-prompt.snap, with-mcp-hub-provided.snap, with-undefined-mcp-hub.snap (from system-prompt.spec.ts).
  • Also updated the 3 matching snapshots referenced by add-custom-instructions.spec.ts: architect-mode-prompt.snap, ask-mode-prompt.snap, no-mcp-servers.snap.
  • While auditing the snapshot directory, removed 5 orphaned snapshot files no longer referenced by any test: with-computer-use-support.snap, with-different-viewport-size.snap, with-diff-enabled-{true,false,undefined}.snap.

Test Procedure

  • Ran the full suite with pnpm test (turbo test) — 462 test files / 7754 tests passed, 39 skipped, no unrelated failures.
  • Ran the affected specs directly:
    npx vitest run core/prompts/__tests__/system-prompt.spec.ts core/prompts/__tests__/add-custom-instructions.spec.ts
    
    All 30 tests passed.
  • Reviewers can verify by checking the git diff: the tab-to-no-indent change in system.ts, and the corresponding \t# Tool Use Guidelines# Tool Use Guidelines change in the snapshot files.

Pre-Submission Checklist

  • Issue Linked: pending — link the issue number above once filed
  • Scope: limited to the system prompt indentation fix and the related snapshot cleanup
  • Self-Review: reviewed the diff myself
  • Testing: updated the affected snapshot tests and confirmed the full suite passes
  • Visual Snapshot (UI changes only): not applicable — no UI change, only system prompt text
  • Documentation Impact: no user-facing documentation update needed (see below)
  • Contribution Guidelines: read and agreed

Documentation Updates

  • No documentation updates are required.

Get in Touch

hehegwk_23849

Summary by CodeRabbit

  • Style
    • Cleaned up indentation in internal prompt formatting without changing functionality or generated content.

Removes a leading tab character before getToolUseGuidelinesSection()
in the system prompt that made it render indented, unlike every other
section. Updates the affected snapshots and drops 5 orphaned snapshot
files no longer referenced by any test.

Signed-off-by: daewoongoh <dw.oh@samsung.com>
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f0e10b84-245f-40a9-a2c3-c9dd7ba788bf

📥 Commits

Reviewing files that changed from the base of the PR and between b0fdbc7 and 446bef3.

⛔ Files ignored due to path filters (11)
  • src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/add-custom-instructions/no-mcp-servers.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-true.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-undefined.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-different-viewport-size.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap is excluded by !**/*.snap
  • src/core/prompts/__tests__/__snapshots__/system-prompt/with-undefined-mcp-hub.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • src/core/prompts/system.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The system prompt template removes the leading tab before the getToolUseGuidelinesSection() output. No logic or control flow changes.

Changes

Prompt formatting

Layer / File(s) Summary
System prompt indentation
src/core/prompts/system.ts
The tool-use guidelines section is inserted without leading tab indentation.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 446be

This localized change removes unintended indentation from a system-prompt section and updates its snapshots; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: edelauna

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The prompt indentation fix and its affected snapshot updates are in scope for issue #1415. Removing five orphaned snapshot files is separate snapshot-directory cleanup and is not required by the linke… Remove the five orphaned snapshot deletions from this pull request, or link an approved issue that explicitly requires this cleanup and explain its relationship to the prompt fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: removing the stray tab before the Tool Use Guidelines section.
Description check ✅ Passed The description includes the linked issue, implementation details, test procedures, checklist, and documentation impact. It provides sufficient review context, although the Issue Linked checklist item…
Linked Issues check ✅ Passed The PR removes the leading tab before the Tool Use Guidelines subsection in src/core/prompts/system.ts, which directly satisfies issue #1415. The related snapshot updates are consistent with the promp…
Full details: Description check

Explanation

The description includes the linked issue, implementation details, test procedures, checklist, and documentation impact. It provides sufficient review context, although the Issue Linked checklist item says "pending" despite linking issue #1415.

Full details: Linked Issues check

Explanation

The PR removes the leading tab before the Tool Use Guidelines subsection in src/core/prompts/system.ts, which directly satisfies issue #1415. The related snapshot updates are consistent with the prompt output change; snapshot files were excluded by the !**/*.snap path filter, so their contents cannot be independently verified here.

Full details: Out of Scope Changes check

Explanation

The prompt indentation fix and its affected snapshot updates are in scope for issue #1415. Removing five orphaned snapshot files is separate snapshot-directory cleanup and is not required by the linked issue.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/core/prompts/system.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Stray tab before "Tool Use Guidelines" in the system prompt

1 participant