From ff7dbb58678abd3fe09cfc67efef2fe266193764 Mon Sep 17 00:00:00 2001 From: Aikins Laryea Date: Wed, 1 Apr 2026 20:04:00 +0000 Subject: [PATCH] test(amp): update tests to expect thinking blocks to pass through during streaming --- internal/api/modules/amp/response_rewriter_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/api/modules/amp/response_rewriter_test.go b/internal/api/modules/amp/response_rewriter_test.go index 2f23d74d..4ff597d7 100644 --- a/internal/api/modules/amp/response_rewriter_test.go +++ b/internal/api/modules/amp/response_rewriter_test.go @@ -100,17 +100,14 @@ func TestRewriteStreamChunk_MessageModel(t *testing.T) { } } -func TestRewriteStreamChunk_SuppressesThinkingContentBlockFrames(t *testing.T) { - rw := &ResponseRewriter{suppressedContentBlock: make(map[int]struct{})} +func TestRewriteStreamChunk_PassesThroughThinkingBlocks(t *testing.T) { + rw := &ResponseRewriter{} chunk := []byte("event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"abc\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"name\":\"bash\",\"input\":{}}}\n\n") result := rw.rewriteStreamChunk(chunk) - if contains(result, []byte("\"thinking\"")) || contains(result, []byte("\"thinking_delta\"")) { - t.Fatalf("expected thinking content_block frames to be suppressed, got %s", string(result)) - } - if contains(result, []byte("content_block_stop")) { - t.Fatalf("expected suppressed thinking content_block_stop to be removed, got %s", string(result)) + if !contains(result, []byte("\"thinking_delta\"")) { + t.Fatalf("expected thinking blocks to pass through in streaming, got %s", string(result)) } if !contains(result, []byte("\"tool_use\"")) { t.Fatalf("expected tool_use content_block frame to remain, got %s", string(result))