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

Function TestUserAgent

coderd/x/chatd/chatprovider/useragent_test.go:18–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func TestUserAgent(t *testing.T) {
19 t.Parallel()
20 ua := chatprovider.UserAgent()
21
22 // Must start with "coder-agents/" so LLM providers can
23 // identify traffic from Coder.
24 require.True(t, strings.HasPrefix(ua, "coder-agents/"),
25 "User-Agent should start with 'coder-agents/', got %q", ua)
26
27 // Must contain the build version.
28 assert.Contains(t, ua, buildinfo.Version())
29
30 // Must contain OS/arch.
31 assert.Contains(t, ua, runtime.GOOS+"/"+runtime.GOARCH)
32}
33
34func TestModelFromConfig_UserAgent(t *testing.T) {
35 t.Parallel()

Callers

nothing calls this directly

Calls 3

UserAgentFunction · 0.92
VersionFunction · 0.92
ContainsMethod · 0.45

Tested by

no test coverage detected