MCPcopy Index your code
hub / github.com/coder/coder / TestGuessClient

Function TestGuessClient

aibridge/client_test.go:12–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestGuessClient(t *testing.T) {
13 t.Parallel()
14
15 tests := []struct {
16 name string
17 userAgent string
18 headers map[string]string
19 wantClient aibridge.Client
20 }{
21 {
22 name: "mux",
23 userAgent: "mux/0.19.0-next.2.gcceff159 ai-sdk/openai/3.0.36 ai-sdk/provider-utils/4.0.15 runtime/node.js/22",
24 wantClient: aibridge.ClientMux,
25 },
26 {
27 name: "claude_code",
28 userAgent: "claude-cli/2.0.67 (external, cli)",
29 wantClient: aibridge.ClientClaudeCode,
30 },
31 {
32 name: "codex_cli",
33 userAgent: "codex_cli_rs/0.87.0 (Mac OS 26.2.0; arm64) ghostty/1.3.0-main_250877ef",
34 wantClient: aibridge.ClientCodex,
35 },
36 {
37 name: "zed",
38 userAgent: "Zed/0.219.4+stable.119.abc123 (macos; aarch64)",
39 wantClient: aibridge.ClientZed,
40 },
41 {
42 name: "github_copilot_vsc",
43 userAgent: "GitHubCopilotChat/0.37.2026011603",
44 wantClient: aibridge.ClientCopilotVSC,
45 },
46 {
47 name: "github_copilot_cli",
48 userAgent: "copilot/0.0.403 (client/cli linux v24.11.1)",
49 wantClient: aibridge.ClientCopilotCLI,
50 },
51 {
52 name: "kilo_code_user_agent",
53 userAgent: "kilo-code/5.1.0 (darwin 25.2.0; arm64) node/22.21.1",
54 wantClient: aibridge.ClientKilo,
55 },
56 {
57 name: "kilo_code_originator",
58 headers: map[string]string{"Originator": "kilo-code"},
59 wantClient: aibridge.ClientKilo,
60 },
61 {
62 name: "roo_code_user_agent",
63 userAgent: "roo-code/3.45.0 (darwin 25.2.0; arm64) node/22.21.1",
64 wantClient: aibridge.ClientRoo,
65 },
66 {
67 name: "roo_code_originator",
68 headers: map[string]string{"Originator": "roo-code"},
69 wantClient: aibridge.ClientRoo,

Callers

nothing calls this directly

Calls 5

GuessClientFunction · 0.92
RunMethod · 0.65
ContextMethod · 0.65
SetMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected