Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion detection/branchname/branchname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ func TestDetectNoMatch(t *testing.T) {
cases := []string{
"main",
"feature/add-login",
"fix-codex-typo", // "codex" appears, but not as a branch prefix
"fix-codex-typo", // "codex" appears, but not as a branch prefix
"rooster/fix-bug", // starts with "roo", but not "roo/"
"windsurfer/refactor", // starts with "windsurf", but not "windsurf/"
"openhands-discussion", // missing trailing slash "openhands/"
"swe-agent-docs", // missing trailing slash "swe-agent/"
"feature/roo-code", // prefix appears in body, not at start
"",
}

Expand Down
24 changes: 16 additions & 8 deletions detection/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ var SupportedToolsInMentions = []string{
// KnownAgentBranchPrefixes maps branch name prefixes used by AI coding CLIs/agents
// when they create their own branches (e.g. "codex/fix-bug") to tool names.
var KnownAgentBranchPrefixes = map[string]string{
"codex/": "OpenAI Codex",
"claude/": "Claude",
"copilot/": "GitHub Copilot",
"cursor/": "Cursor",
"devin/": "Devin",
"cline/": "Cline",
"aider/": "Aider",
"gemini/": "Gemini",
"codex/": "OpenAI Codex",
"claude/": "Claude",
"copilot/": "GitHub Copilot",
"cursor/": "Cursor",
"devin/": "Devin",
"cline/": "Cline",
"aider/": "Aider",
"gemini/": "Gemini",
"roo/": "Roo Code",
"roo-code/": "Roo Code",
"windsurf/": "Windsurf",
"openhands/": "OpenHands",
"swe-agent/": "SWE-Agent",
}

// KnownCoAuthorEmails Known emails present with Co-Authored-By trailers
Expand All @@ -156,6 +161,9 @@ var KnownCoAuthorEmails = map[string]string{
"cursoragent@cursor.com": "Cursor",
"noreply@aider.chat": "Aider",
"copilot@github.com": "Copilot",
"noreply@continue.dev": "Continue.dev",
"noreply@windsurf.com": "Windsurf",
"openhands@all-hands.dev": "OpenHands",
}

// CoAuthorPattern Regex to look for Co-Authored-By trailer with name and email
Expand Down
40 changes: 40 additions & 0 deletions detection/trailer/trailer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,46 @@ func TestDetect(t *testing.T) {
wantScore: []float64{85},
wantConfidence: []detection.Confidence{detection.ConfidenceHigh},
},
{
name: "coauthor: Continue.dev trailer",
message: "feat: add feature\n\nCo-Authored-By: Continue <noreply@continue.dev>",
wantTools: []string{"Continue.dev"},
wantModels: []string{""},
wantScore: []float64{75},
wantConfidence: []detection.Confidence{detection.ConfidenceHigh},
},
{
name: "coauthor: Windsurf trailer",
message: "feat: add feature\n\nCo-Authored-By: Windsurf <noreply@windsurf.com>",
wantTools: []string{"Windsurf"},
wantModels: []string{""},
wantScore: []float64{75},
wantConfidence: []detection.Confidence{detection.ConfidenceHigh},
},
{
name: "coauthor: OpenHands trailer",
message: "feat: add feature\n\nCo-Authored-By: OpenHands <openhands@all-hands.dev>",
wantTools: []string{"OpenHands"},
wantModels: []string{""},
wantScore: []float64{75},
wantConfidence: []detection.Confidence{detection.ConfidenceHigh},
},
{
name: "coauthor: negative - unknown email domain for Continue",
message: "feat: add feature\n\nCo-Authored-By: Continue <user@customdomain.com>",
wantTools: []string{},
wantModels: []string{},
wantScore: []float64{},
wantConfidence: []detection.Confidence{},
},
{
name: "coauthor: negative - human coauthor with AI tool name in username",
message: "feat: add feature\n\nCo-Authored-By: Windsurfer <human@mycompany.org>",
wantTools: []string{},
wantModels: []string{},
wantScore: []float64{},
wantConfidence: []detection.Confidence{},
},
{
name: "coauthor: Cursor trailer with parenthesized model",
message: "refactor: extract method\n\nCo-Authored-By: Cursor (composer 2.5) <cursoragent@cursor.com>",
Expand Down