Oil temperature plays a crucial role in hydraulic closed-circuit systems (HCS), and conventional thermal equilibrium models and coupled simulation models face challenges in terms of accuracy, efficiency, and cost when calculating oil temperature. This study introduces an innovative HCS oil temperature precise prediction model and oil refilling parameter optimization method. The initial sample space was determined through a Sobol sensitivity analysis and improved Latin hypercube sampling, leading to the development of a combinatorial agent model (CAM) suitable for oil temperature prediction with superior accuracy and stability compared to other methods. Based on CAM, the optimal oil refilling flow rates under various operational conditions are computed. To validate the efficacy of the theoretical analysis, an HCS experiment platform was established. The data indicates that the temperature prediction error range of the CAM model falls between 0.30 °C and 1.05 °C, and optimizing the oil refilling flow rate can effectively enhance system efficiency while ensuring that the oil temperature remains within permissible limits. The research methodology and findings are applicable in engineering practice and can be extended to optimize the design of other hydraulic systems.