refactor: stop rewriting tool descriptions; keep only system sentence rewrite

This commit is contained in:
cyhhao
2026-01-31 02:01:51 +08:00
parent fe17058700
commit 3a34746668
2 changed files with 7 additions and 17 deletions

View File

@@ -13,8 +13,9 @@ func TestSanitizeOpenCodeText_RewritesCanonicalSentence(t *testing.T) {
require.Equal(t, strings.TrimSpace(claudeCodeSystemPrompt), got)
}
func TestSanitizeToolText_RewritesOpenCodeKeywords(t *testing.T) {
func TestSanitizeToolDescription_DoesNotRewriteKeywords(t *testing.T) {
in := "OpenCode and opencode are mentioned."
got := sanitizeToolText(in)
require.Equal(t, "Claude Code and Claude are mentioned.", got)
got := sanitizeToolDescription(in)
// We no longer rewrite tool descriptions; only redact obvious path leaks.
require.Equal(t, in, got)
}