Skip to content

fix(swe): preserve sampled tokens in empty final responses - #3823

Merged
cmunley1 merged 2 commits into
NVIDIA-NeMo:mainfrom
wdykas:fix/preserve-empty-sampled-trajectory
Oct 8, 2026
Merged

cmunley1 merged 2 commits into
NVIDIA-NeMo:mainfrom
wdykas:fix/preserve-empty-sampled-trajectory

Conversation

@wdykas

@wdykas wdykas commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The SWE agent drops a final assistant response when its content and tool calls
are empty, even if it contains sampled token IDs and log probabilities. This
omits EOS-only completions from the returned training trajectory. With earlier
turns present, the trajectory can still be accepted for training without its
final sampled action.

Retain the final message when it contains generated token IDs, after merging
provider-specific metadata. Responses without sampled tokens remain excluded;
nonempty content and tool-call behavior are unchanged.

@copy-pr-bot

copy-pr-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@wdykas
wdykas marked this pull request as ready for review October 6, 2026 22:29

@wdykas wdykas left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI code review (Codex) of 1b7def69b5bc29d3d0b370c5e7b2a0f2f52b5cb5: LGTM — no actionable findings.

Reviewed final-message retention, provider-field precedence, both trajectory materialization callers, and downstream Responses conversion. All 24 focused regression cases passed locally. Full model/SWE smoke rollouts were not run.

@wdykas

wdykas commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

@ananthsub
ananthsub requested a review from sdevare-nv October 6, 2026 22:52
@ananthsub

Copy link
Copy Markdown
Contributor

/ok to test 1b7def6

@cmunley1

cmunley1 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

/ok to test 2b9d9b1

@copy-pr-bot

copy-pr-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

/ok to test 2b9d9b1

@cmunley1, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@yaoyu-33 yaoyu-33 added area:agent Agent harnesses and Responses API agent behavior bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer labels Oct 6, 2026
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Oct 7, 2026

@sdevare-nv sdevare-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Oct 8, 2026
@wdykas

wdykas commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2b9d9b1

@cmunley1

cmunley1 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

/ok to test 2b9d9b1

@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

/ok to test 2b9d9b1

@cmunley1, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@cmunley1

cmunley1 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

/ok to test 2b9d9b1

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37817000016

Merged via the queue into NVIDIA-NeMo:main with commit 3df508f Oct 8, 2026
47 checks passed

This branch was previously deployed

1 inactive deployment
public — 2b9d9b1e Deployed Oct 8, 2026 by copy-pr-bot[bot] via release / finalize / notify #4743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants