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

Function TestPackKeepsPairedToolMessage

internal/ctx/ctx_test.go:176–186  ·  view source on GitHub ↗

TestPackKeepsPairedToolMessage: a healthy assistant+tool pair that fits the budget stays intact: don't regress into dropping good pairs.

(t *testing.T)

Source from the content-addressed store, hash-verified

174 t.Fatalf("empty-ID tool message survived pack: %+v (full kept set: %+v)", m, r.Messages)
175 }
176 }
177}
178
179// TestPackKeepsPairedToolMessage: a healthy assistant+tool pair that fits the
180// budget stays intact: don't regress into dropping good pairs.
181func TestPackKeepsPairedToolMessage(t *testing.T) {
182 history := []Message{
183 {Role: RoleAssistant, ToolCalls: []ToolCall{{ID: "c1", Name: "bash"}}},
184 {Role: RoleTool, ToolCallID: "c1", Content: "ok"},
185 {Role: RoleAssistant, Content: "done"},
186 }
187 r := Pack(history, 10000)
188 if len(r.Messages) != 3 {
189 t.Fatalf("all 3 messages should be kept, got %d: %+v", len(r.Messages), r.Messages)

Callers

nothing calls this directly

Calls 1

PackFunction · 0.85

Tested by

no test coverage detected