@@ -1387,7 +1387,7 @@ def test_extract_rag_chunks_with_results(self, mocker: MockerFixture) -> None:
13871387
13881388 assert len (rag_chunks ) == 2
13891389 assert rag_chunks [0 ].content == "chunk 1"
1390- assert rag_chunks [0 ].source == "doc1.pdf"
1390+ assert rag_chunks [0 ].source is None
13911391 assert rag_chunks [0 ].score == 0.9
13921392
13931393 def test_extract_rag_chunks_no_results (self , mocker : MockerFixture ) -> None :
@@ -1596,12 +1596,12 @@ def test_single_store_mapped(self, mocker: MockerFixture) -> None:
15961596 assert source == "ocp-4.18-docs"
15971597
15981598 def test_single_store_unmapped (self , mocker : MockerFixture ) -> None :
1599- """Test resolution with single vector store without mapping falls back to filename ."""
1599+ """Test resolution with single vector store without mapping returns raw store ID ."""
16001600 mock_result = mocker .Mock ()
16011601 mock_result .filename = "file-abc123"
16021602
16031603 source = _resolve_source_for_result (mock_result , ["vs-unknown" ], {})
1604- assert source == "file-abc123 "
1604+ assert source == "vs-unknown "
16051605
16061606 def test_multiple_stores_with_attribute (self , mocker : MockerFixture ) -> None :
16071607 """Test resolution with multiple stores using result attributes."""
@@ -1617,7 +1617,7 @@ def test_multiple_stores_with_attribute(self, mocker: MockerFixture) -> None:
16171617 assert source == "rhel-9-docs"
16181618
16191619 def test_multiple_stores_no_attribute (self , mocker : MockerFixture ) -> None :
1620- """Test resolution with multiple stores and no vector_store_id attribute."""
1620+ """Test resolution with multiple stores and no vector_store_id attribute returns None ."""
16211621 mock_result = mocker .Mock ()
16221622 mock_result .filename = "file-abc123"
16231623 mock_result .attributes = {}
@@ -1627,20 +1627,20 @@ def test_multiple_stores_no_attribute(self, mocker: MockerFixture) -> None:
16271627 ["vs-001" , "vs-002" ],
16281628 {"vs-001" : "ocp-4.18-docs" , "vs-002" : "rhel-9-docs" },
16291629 )
1630- assert source == "file-abc123"
1630+ assert source is None
16311631
16321632 def test_no_stores (self , mocker : MockerFixture ) -> None :
1633- """Test resolution with no vector stores falls back to filename ."""
1633+ """Test resolution with no vector stores returns None ."""
16341634 mock_result = mocker .Mock ()
16351635 mock_result .filename = "file-abc123"
16361636
16371637 source = _resolve_source_for_result (mock_result , [], {})
1638- assert source == "file-abc123"
1638+ assert source is None
16391639
16401640 def test_multiple_stores_attribute_not_in_mapping (
16411641 self , mocker : MockerFixture
16421642 ) -> None :
1643- """Test resolution when attribute store ID is not in mapping."""
1643+ """Test resolution when attribute store ID is not in mapping returns raw store ID ."""
16441644 mock_result = mocker .Mock ()
16451645 mock_result .filename = "file-abc123"
16461646 mock_result .attributes = {"vector_store_id" : "vs-unknown" }
@@ -1650,7 +1650,7 @@ def test_multiple_stores_attribute_not_in_mapping(
16501650 ["vs-001" , "vs-002" ],
16511651 {"vs-001" : "ocp-docs" },
16521652 )
1653- assert source == "file-abc123 "
1653+ assert source == "vs-unknown "
16541654
16551655
16561656class TestBuildChunkAttributes :
@@ -1759,7 +1759,7 @@ def test_chunks_no_mapping_falls_back(self, mocker: MockerFixture) -> None:
17591759 extract_rag_chunks_from_file_search_item (mock_item , rag_chunks )
17601760
17611761 assert len (rag_chunks ) == 1
1762- assert rag_chunks [0 ].source == "file-abc"
1762+ assert rag_chunks [0 ].source is None
17631763 assert rag_chunks [0 ].attributes is None
17641764
17651765 def test_chunks_multiple_stores_attribute_resolution (
@@ -1853,7 +1853,7 @@ def test_file_search_without_mapping(self, mocker: MockerFixture) -> None:
18531853 call_summary , _ = build_tool_call_summary (mock_item , rag_chunks )
18541854
18551855 assert len (rag_chunks ) == 1
1856- assert rag_chunks [0 ].source == "doc.pdf"
1856+ assert rag_chunks [0 ].source is None
18571857 assert rag_chunks [0 ].attributes is None
18581858 assert call_summary is not None
18591859
0 commit comments