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))