Skip to content

Commit 099670f

Browse files
authored
feat: recognise Charm Crush client (#217)
Adds Charm Crush client recognition to guessClient based on user agent header.
1 parent 53eb065 commit 099670f

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const (
1717
ClientCopilotCLI Client = "GitHub Copilot (CLI)"
1818
ClientKilo Client = "Kilo Code"
1919
ClientCoderAgents Client = "Coder Agents"
20+
ClientCrush Client = "Charm Crush"
2021
ClientMux Client = "Mux"
2122
ClientRoo Client = "Roo Code"
2223
ClientCursor Client = "Cursor"
@@ -50,6 +51,8 @@ func guessClient(r *http.Request) Client {
5051
return ClientRoo
5152
case strings.HasPrefix(userAgent, "coder-agents/"):
5253
return ClientCoderAgents
54+
case strings.HasPrefix(userAgent, "charm crush/"):
55+
return ClientCrush
5356
case r.Header.Get("x-cursor-client-version") != "":
5457
return ClientCursor
5558
}

client_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ func TestGuessClient(t *testing.T) {
7676
userAgent: "coder-agents/v0.0.0-devel (darwin/arm64)",
7777
wantClient: ClientCoderAgents,
7878
},
79+
{
80+
name: "charm_crush",
81+
userAgent: "Charm Crush/0.1.11",
82+
wantClient: ClientCrush,
83+
},
7984
{
8085
name: "cursor_x_cursor_client_version",
8186
userAgent: "connect-es/1.6.1",

0 commit comments

Comments
 (0)