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

Function TestToolCallSequence

pkg/runtime/runtime_test.go:482–500  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

480}
481
482func TestToolCallSequence(t *testing.T) {
483 t.Parallel()
484
485 stream := newStreamBuilder().
486 AddToolCallName("call_123", "test_tool").
487 AddToolCallArguments("call_123", `{"param": "value"}`).
488 AddStopWithUsage(5, 8).
489 Build()
490
491 sess := session.New(session.WithUserMessage("Please use the test tool"))
492
493 events := runSession(t, sess, stream)
494
495 require.True(t, hasEventType(t, events, &PartialToolCallEvent{}), "Expected PartialToolCallEvent")
496 require.False(t, hasEventType(t, events, &ToolCallEvent{}), "Should not have ToolCallEvent without actual tool execution")
497
498 require.True(t, hasEventType(t, events, &StreamStartedEvent{}), "Expected StreamStartedEvent")
499 require.True(t, hasEventType(t, events, &StreamStoppedEvent{}), "Expected StreamStoppedEvent")
500}
501
502// TestXMLToolCallFallback verifies that <tool_call> blocks in text content
503// are extracted as tool calls and not leaked as AgentChoice events.

Callers

nothing calls this directly

Calls 9

NewFunction · 0.92
WithUserMessageFunction · 0.92
newStreamBuilderFunction · 0.85
runSessionFunction · 0.85
hasEventTypeFunction · 0.85
AddStopWithUsageMethod · 0.80
AddToolCallArgumentsMethod · 0.80
AddToolCallNameMethod · 0.80
BuildMethod · 0.45

Tested by

no test coverage detected