From 652a052227b3b74630eec28c10f7b6ce52482926 Mon Sep 17 00:00:00 2001 From: Lin Chai Date: Mon, 15 Jun 2026 10:58:23 -0700 Subject: [PATCH] [Tunix] Don't skip the special token from the vllm responses in agentic training otherwise, we will need manual processing to previous token shifts. PiperOrigin-RevId: 932555130 --- tunix/rl/agentic/agentic_rl_learner.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tunix/rl/agentic/agentic_rl_learner.py b/tunix/rl/agentic/agentic_rl_learner.py index 247d1c8a7..5fdd2bbed 100644 --- a/tunix/rl/agentic/agentic_rl_learner.py +++ b/tunix/rl/agentic/agentic_rl_learner.py @@ -265,6 +265,14 @@ def _validate_rollout_config(self): configs_to_check = rollout_config for mode, config in configs_to_check.items(): + if config.rollout_vllm_sampling_kwargs is None: + config.rollout_vllm_sampling_kwargs = {} + if ( + "skip_special_tokens" not in config.rollout_vllm_sampling_kwargs + or config.rollout_vllm_sampling_kwargs["skip_special_tokens"] + ): + config.rollout_vllm_sampling_kwargs["skip_special_tokens"] = False + if config.max_tokens_to_generate != self.algo_config.max_response_length: raise ValueError( f"RolloutConfig ({mode}) max_tokens_to_generate "