Make anthropic tool reminder injection optional #701
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Only one of this PR and #700 should be merged. These two PRs are two variants of a fix.
This PR contains:
What is the current behavior? (You can also link to an open issue here)
Currently, whenever we call an Anthropic model with tool calls enabled, a system message "Before answering, explain your reasoning step-by-step in tags." is forcibly injected at the end of the existing system message.
This injection cannot be turned off and is very difficult to detect in the log viewer -- you can see it in the json details of the transcript log which logs raw model requests but not the main Messages view.
What is the new behavior?
The existing behavior is maintained but can now be turned off by setting the anthropic_tool_reminder_injection flag in GenerateConfig. This flag can also be adjusted using the environment variable ANTHROPIC_TOOL_REMINDER_INJECTION and the CLI flag --anthropic-tool-reminder-injection or --no-anthropic-tool-reminder-injection.
An alternate solution is to remove this behavior entirely and give no option for turning it back on (unless the user hardcodes it in at some higher layer of the stack). #700 implements the complete removal change.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.