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

Function TestChatAdvisorConfig_IgnoresLegacyReasoningEffort

coderd/exp_chats_test.go:13031–13053  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13029}
13030
13031func TestChatAdvisorConfig_IgnoresLegacyReasoningEffort(t *testing.T) {
13032 t.Parallel()
13033
13034 ctx := testutil.Context(t, testutil.WaitLong)
13035 adminClient, db := newChatClientWithDatabase(t)
13036 coderdtest.CreateFirstUser(t, adminClient.Client)
13037
13038 stored := `{"enabled":true,"max_uses_per_run":3,"max_output_tokens":2048,"reasoning_effort":"high"}`
13039 err := db.UpsertChatAdvisorConfig(dbauthz.AsSystemRestricted(ctx), stored)
13040 require.NoError(t, err)
13041
13042 resp, err := adminClient.GetChatAdvisorConfig(ctx)
13043 require.NoError(t, err)
13044 require.Equal(t, codersdk.AdvisorConfig{
13045 Enabled: true,
13046 MaxUsesPerRun: 3,
13047 MaxOutputTokens: 2048,
13048 }, resp)
13049
13050 raw, err := db.GetChatAdvisorConfig(dbauthz.AsSystemRestricted(ctx))
13051 require.NoError(t, err)
13052 require.JSONEq(t, stored, raw)
13053}
13054
13055// TestChatAdvisorConfig_CorruptStoredJSONReturnsError pins that the GET
13056// handler surfaces a 500 when the stored site_configs row contains bytes

Callers

nothing calls this directly

Calls 7

ContextFunction · 0.92
CreateFirstUserFunction · 0.92
AsSystemRestrictedFunction · 0.92
GetChatAdvisorConfigMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected