MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestPackKeepsFullyAnsweredToolCalls

Function TestPackKeepsFullyAnsweredToolCalls

internal/ctx/ctx_test.go:463–476  ·  view source on GitHub ↗

TestPackKeepsFullyAnsweredToolCalls: don't over-reach. An assistant whose every tool_call is answered (including parallel) must survive intact.

(t *testing.T)

Source from the content-addressed store, hash-verified

461 t.Fatalf("stray tool result survived via reused ID: %+v", r.Messages)
462 }
463 }
464}
465
466// TestPackKeepsFullyAnsweredToolCalls: don't over-reach. An assistant whose
467// every tool_call is answered (including parallel) must survive intact.
468func TestPackKeepsFullyAnsweredToolCalls(t *testing.T) {
469 history := []Message{
470 {Role: RoleAssistant, ToolCalls: []ToolCall{
471 {ID: "c1", Name: "bash"}, {ID: "c2", Name: "bash"},
472 }},
473 {Role: RoleTool, ToolCallID: "c1", Content: "out1"},
474 {Role: RoleTool, ToolCallID: "c2", Content: "out2"},
475 {Role: RoleAssistant, Content: "done"},
476 }
477 r := Pack(history, 100000)
478 if len(r.Messages) != 4 {
479 t.Fatalf("fully-answered group must survive, got %d: %+v", len(r.Messages), r.Messages)

Callers

nothing calls this directly

Calls 1

PackFunction · 0.85

Tested by

no test coverage detected