Skip to content

fix(agent): propagate multi-turn rollout truncation - #1327

Merged
hijkzzz merged 2 commits into
OpenRLHF:mainfrom
Excelius-Wang:fix/multiturn-truncation
Sep 10, 2026
Merged

hijkzzz merged 2 commits into
OpenRLHF:mainfrom
Excelius-Wang:fix/multiturn-truncation

Conversation

@Excelius-Wang

Copy link
Copy Markdown
Contributor

MultiTurnAgentExecutor drops vLLM's finish_reason="length", so sample conversion marks those rollouts as untruncated. This underreports truncation metrics and bypasses the stop-properly reward penalty when enabled.

Carry the final generation's truncation flag in the executor response, matching SingleTurnAgentExecutor and reusing the existing sample conversion and penalty logic.

Validation: 24 regression cases covering stop/length endings over one or two turns, with and without logprobs, and three penalty coefficients. The unpatched code fails all 12 length cases; the patched full test suite passes (46 tests). Compileall and pre-commit pass. A separate CPU probe using the shipped AgentInstance, 30 public texts and tiny-model generation also passes; no full GPU training run was performed.

@hijkzzz
hijkzzz merged commit 1400db4 into OpenRLHF:main Sep 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants