def test_cross_tool_conversation_history_includes_tool_names(self, mock_redis):
        """Test that conversation history properly shows which tool was used for each turn"""
        mock_client = Mock()
        mock_redis.return_value = mock_client

        # Create a thread context with turns from different tools
        thread_context = ThreadContext(
            thread_id="12345678-1234-1234-1234-123456789012",
            created_at="2023-01-01T00:00:00Z",
            last_updated_at="2023-01-01T00:03:00Z",
            tool_name="test_analysis",  # Original tool
            turns=[
                ConversationTurn(
                    role="assistant",
                    content="Analysis complete: Found 3 issues",
                    timestamp="2023-01-01T00:01:00Z",
                    tool_name="test_analysis",
                ),
                ConversationTurn(
                    role="assistant",
                    content="Review complete: 2 critical, 1 minor issue",
                    timestamp="2023-01-01T00:02:00Z",
                    tool_name="test_review",
                ),
                ConversationTurn(
                    role="assistant",
                    content="Deep analysis: Root cause identified",
                    timestamp="2023-01-01T00:03:00Z",
                    tool_name="test_thinkdeep",
                ),
            ],
            initial_context={"code": "test code"},
        )

        # Build conversation history
        from utils.conversation_memory import build_conversation_history

        history, tokens = build_conversation_history(thread_context)

        # Verify tool names are included in the history
        assert "Turn 1 (Gemini using test_analysis)" in history
        assert "Turn 2 (Gemini using test_review)" in history
        assert "Turn 3 (Gemini using test_thinkdeep)" in history
        assert "Analysis complete: Found 3 issues" in history
        assert "Review complete: 2 critical, 1 minor issue" in history
        assert "Deep analysis: Root cause identified" in history
Test that conversation history properly shows which tool was used for each turn
tests/test_cross_tool_continuation.py