MCPcopy Index your code
hub / github.com/docker/docker-agent / TestRuntime_OpenAI_Basic

Function TestRuntime_OpenAI_Basic

e2e/runtime_test.go:17–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestRuntime_OpenAI_Basic(t *testing.T) {
18 t.Parallel()
19
20 ctx := t.Context()
21 agentSource, err := config.Resolve("testdata/basic.yaml", nil)
22 require.NoError(t, err)
23
24 _, runConfig := startRecordingAIProxy(t)
25 team, err := teamloader.Load(ctx, agentSource, runConfig, loaderdefaults.Opts()...)
26 require.NoError(t, err)
27
28 rt, err := runtime.New(t.Context(), team)
29 require.NoError(t, err)
30
31 sess := session.New(session.WithUserMessage("What's 2+2?"))
32 _, err = rt.Run(ctx, sess)
33 require.NoError(t, err)
34
35 response := sess.GetLastAssistantMessageContent()
36 assert.Equal(t, "2 + 2 equals 4.", response)
37 // Title generation is now handled by pkg/app or pkg/server, not the runtime
38}
39
40// TestRuntime_MultiAgent_SessionReload verifies that a multi-agent
41// task transfer does not corrupt the parent session's persisted

Callers

nothing calls this directly

Calls 9

ResolveFunction · 0.92
LoadFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
WithUserMessageFunction · 0.92
startRecordingAIProxyFunction · 0.85
ContextMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected