-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: remove <thinking> tags from prompts for cleaner output and fewer tokens #8319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…r tokens - Remove <thinking></thinking> tags from tool-use-guidelines.ts - Remove <thinking></thinking> tags from objective.ts - Remove <thinking></thinking> tags from attempt-completion.ts - Update test expectations to match new prompt format - Keep the behavioral rule (confirm tool success) in plain language Fixes #8318
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review routine engaged: judging my own code with machine-like indifference to see if the tags truly vanished.
| return `## attempt_completion | ||
| Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again. | ||
| IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must ask yourself in <thinking></thinking> tags if you've confirmed from the user that any previous tool uses were successful. If not, then DO NOT use this tool. | ||
| IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must confirm that you've received successful results from the user for any previous tool uses. If not, then DO NOT use this tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] Clarity tweak: explicitly require "explicit confirmation" and block usage if any tool result is missing/unclear. This mirrors current behavior but reduces ambiguity for some models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes all <thinking> tags from AI prompts to create cleaner output, reduce token usage, and prevent models from treating the tags as special syntax while preserving the underlying behavioral requirements.
- Replaced
<thinking></thinking>tag references with direct analysis instructions - Updated test expectations to match the new prompt format without thinking tags
- Maintained core behavioral rules about confirming tool success before proceeding
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/prompts/tools/attempt-completion.ts | Removed thinking tag requirement from tool validation instructions |
| src/core/prompts/sections/tool-use-guidelines.ts | Changed thinking tag guidance to direct assessment instruction |
| src/core/prompts/sections/objective.ts | Replaced thinking tag analysis with plain analysis instruction |
| src/core/prompts/sections/tests/tool-use-guidelines.spec.ts | Updated test expectations to match new guideline format |
| src/core/prompts/sections/tests/objective.spec.ts | Updated test description and expectations for analysis guidance |
| Multiple snapshot files | Updated system prompt snapshots to reflect removed thinking tags |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
This PR addresses Issue #8318 by removing all references to
<thinking>tags from prompts while preserving the underlying behavioral rules.Changes
<thinking></thinking>tags from tool-use-guidelines.ts<thinking></thinking>tags from objective.ts<thinking></thinking>tags from attempt-completion.tsBenefits
Testing
Fixes #8318
Important
Removed
<thinking>tags from prompts for cleaner output and fewer tokens, updating tests to match the new format.<thinking></thinking>tags fromtool-use-guidelines.ts,objective.ts, andattempt-completion.ts.objective.spec.tsandtool-use-guidelines.spec.tsto match the new prompt format.This description was created by
for c5f4ba2. You can customize this summary. It will automatically update as commits are pushed.