refactor: limit OpenCode keyword replacement to tool descriptions

This commit is contained in:
cyhhao
2026-01-31 01:40:38 +08:00
parent 602bf9c017
commit fe17058700
2 changed files with 21 additions and 7 deletions

View File

@@ -9,12 +9,12 @@ import (
func TestSanitizeOpenCodeText_RewritesCanonicalSentence(t *testing.T) {
in := "You are OpenCode, the best coding agent on the planet."
got := sanitizeOpenCodeText(in)
got := sanitizeSystemText(in)
require.Equal(t, strings.TrimSpace(claudeCodeSystemPrompt), got)
}
func TestSanitizeOpenCodeText_RewritesOpenCodeKeywords(t *testing.T) {
func TestSanitizeToolText_RewritesOpenCodeKeywords(t *testing.T) {
in := "OpenCode and opencode are mentioned."
got := sanitizeOpenCodeText(in)
got := sanitizeToolText(in)
require.Equal(t, "Claude Code and Claude are mentioned.", got)
}