From c716ef9a63a5ef2910e18eef77081d826c8482fb Mon Sep 17 00:00:00 2001 From: Matt Faltyn Date: Fri, 11 Sep 2026 12:18:49 +0200 Subject: [PATCH] test(agent): measure item projection --- internal/mcp/dispatch_http_item_list_summary_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/mcp/dispatch_http_item_list_summary_test.go b/internal/mcp/dispatch_http_item_list_summary_test.go index 4f2b12c28..ff4d9feef 100644 --- a/internal/mcp/dispatch_http_item_list_summary_test.go +++ b/internal/mcp/dispatch_http_item_list_summary_test.go @@ -181,6 +181,14 @@ func TestHTTPItemList_FullOptsIntoCompleteBodies(t *testing.T) { func TestHTTPItemShow_AgentProjectionKeepsBodyAndDropsStoragePlumbing(t *testing.T) { d := newListSummaryFixture(t) + rawCtx := WithDispatchInput(context.Background(), map[string]any{ + "workspace": "list-ws", + "ref": "TASK-1", + }) + rawRes, rawErr := d.Dispatch(rawCtx, []string{"item", "show"}, nil) + if rawErr != nil || rawRes.IsError { + t.Fatalf("default item show failed: err=%v result=%s", rawErr, textOf(rawRes)) + } ctx := WithDispatchInput(context.Background(), map[string]any{ "workspace": "list-ws", "ref": "TASK-1", @@ -194,6 +202,10 @@ func TestHTTPItemShow_AgentProjectionKeepsBodyAndDropsStoragePlumbing(t *testing t.Fatalf("Dispatch(item show) returned an error result: %s", textOf(res)) } text := textOf(res) + t.Logf("item show fixture: %d bytes default, %d bytes agent projection", len(textOf(rawRes)), len(text)) + if len(text) >= len(textOf(rawRes)) { + t.Errorf("agent projection should be smaller than default item JSON: default=%d agent=%d", len(textOf(rawRes)), len(text)) + } if !strings.Contains(text, listSummaryContentMarker) { t.Errorf("agent item view dropped the full body:\n%s", text) }