diff --git a/internal/runtime/executor/devin_executor_test.go b/internal/runtime/executor/devin_executor_test.go index 791d02b7e..fd142588c 100644 --- a/internal/runtime/executor/devin_executor_test.go +++ b/internal/runtime/executor/devin_executor_test.go @@ -87,13 +87,13 @@ func TestDevinExecutor_GetSensitiveWords(t *testing.T) { eWithWords := &DevinExecutor{ cfg: &config.Config{ Devin: config.DevinConfig{ - SensitiveWords: []string{"Hermes", "Claude Agent SDK"}, + SensitiveWords: []string{"sample-word-1", "sample-word-2"}, }, }, } words := eWithWords.getSensitiveWords() - if len(words) != 2 || words[0] != "Hermes" || words[1] != "Claude Agent SDK" { - t.Errorf("words = %v, want [Hermes Claude Agent SDK]", words) + if len(words) != 2 || words[0] != "sample-word-1" || words[1] != "sample-word-2" { + t.Errorf("words = %v, want [sample-word-1 sample-word-2]", words) } } diff --git a/internal/runtime/executor/helps/devin_wire.go b/internal/runtime/executor/helps/devin_wire.go index cdba5ec88..81b78fe52 100644 --- a/internal/runtime/executor/helps/devin_wire.go +++ b/internal/runtime/executor/helps/devin_wire.go @@ -527,10 +527,7 @@ func SanitizeDevinSystemPrompt(prompt string, matcher *SensitiveWordMatcher) str if util.IsClaudeCodeAttributionSystemText(trimmed) { continue } - if strings.HasPrefix(trimmed, "You are Claude Code") || strings.HasPrefix(trimmed, "You are a Claude agent") || strings.HasPrefix(trimmed, "You are an agent for Claude Code") { - continue - } - if strings.Contains(trimmed, "Claude Agent SDK") || strings.Contains(trimmed, "avoid using emojis") { + if strings.HasPrefix(trimmed, "You are Claude Code") { continue } if strings.Contains(trimmed, "authorized security testing") || strings.Contains(trimmed, "destructive techniques, DoS attacks") { diff --git a/internal/runtime/executor/helps/devin_wire_test.go b/internal/runtime/executor/helps/devin_wire_test.go index 17b777552..58d3ae1d6 100644 --- a/internal/runtime/executor/helps/devin_wire_test.go +++ b/internal/runtime/executor/helps/devin_wire_test.go @@ -141,14 +141,14 @@ func TestBuildDevinGetChatMessageRequest_SensitiveWordsOnlyInSystemPrompt(t *tes func TestSanitizeDevinSystemPrompt_AndSensitiveWords(t *testing.T) { matcher := BuildSensitiveWordMatcher([]string{"API", "proxy"}) - rawPrompt := "x-anthropic-billing-header: cc_version=2.1.260;\nYou are Claude Code, Anthropic's official CLI for Claude.\nYou are a Claude agent, built on Anthropic's Claude Agent SDK.\n- For clear communication with the user the assistant MUST avoid using emojis.\nHelp the project with API and proxy." + rawPrompt := "x-anthropic-billing-header: cc_version=2.1.260;\nYou are Claude Code, Anthropic's official CLI for Claude.\nHelp the project with API and proxy." sanitized := SanitizeDevinSystemPrompt(rawPrompt, matcher) if strings.Contains(sanitized, "x-anthropic-billing-header") { t.Errorf("sanitized prompt still contains billing header: %s", sanitized) } - if strings.Contains(sanitized, "You are Claude Code") || strings.Contains(sanitized, "Claude Agent SDK") || strings.Contains(sanitized, "avoid using emojis") { - t.Errorf("sanitized prompt still contains blocked Claude subagent phrases: %s", sanitized) + if strings.Contains(sanitized, "You are Claude Code") { + t.Errorf("sanitized prompt still contains Claude Code identity: %s", sanitized) } if strings.Contains(sanitized, "API") && !strings.Contains(sanitized, zeroWidthSpace) { t.Errorf("API was not obfuscated with zero-width space")