Skip to content

fix(opencode): match token capture to the call that produced the scored reply - #6922

Open
yutianjiang39 wants to merge 5 commits into
NVIDIA-NeMo:mainfrom
yutianjiang39:contrib/issue-5609
Open

yutianjiang39 wants to merge 5 commits into
NVIDIA-NeMo:mainfrom
yutianjiang39:contrib/issue-5609

Conversation

@yutianjiang39

Copy link
Copy Markdown

What does this PR do?

Closes #5609. When an adapter removes a leading <think>…</think> block for scoring, token capture now matches the original reply to the call that produced it. The adapter binds a fingerprint of the complete reply to the scored message. This lets capture distinguish that call from an auxiliary call that returned the same bare answer. The change covers the host, session, and deprecated sandbox adapter paths.

Validation

Check in checks.json Baseline 64e3bc70b with regression tests only Baseline with patch applied
focused 5 failed: one missing match and four auxiliary calls selected 5 passed
suite Not run 931 passed

Rollouts

In the two-root regression fixture, one call returns <think>r</think>\n\n4 and the other returns 4. The verifier still sees 4. On both host and session paths, capture selects the call that returned the wrapped reply, delivers only its generation token IDs ([4] in the fixture), and leaves the sample unmasked. The same assertions pass with trailing reasoning.

Compatibility and benchmark impact

Token capture remains opt-in. Scoring, literal think tags in other harnesses, and the single-clean-chain fallback are unchanged. An empty text fragment does not invalidate a complete reply. If a malformed neighboring part makes the source uncertain, scoring still receives the answer; without independent evidence, a multi-root sample stays masked. The checks exercise local artifacts and token delivery, not benchmark performance.

Carry the scored reply binding in an adapter-owned response field so echoed request metadata leaves literal content matches intact. Skip fingerprinting a null source after export conversion has emitted the empty message.

Signed-off-by: yutianjiang39 <[email protected]>
Check the scored step for reasoning split from an adjacent text part. Exclude synthetic and ignored text from model evidence and allow bookkeeping records beside an otherwise complete reply.

Signed-off-by: yutianjiang39 <[email protected]>
An empty text fragment adds nothing to the served reply. Keep substantive and unknown neighbors ambiguous, including JSON types that cannot be hashed.

Signed-off-by: yutianjiang39 <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 29, 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.

@github-actions github-actions Bot added the community-request Issue reported or requested by someone from the community label Nov 29, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added risk:high Autobot PR risk: high bug Something isn't working area:agent Agent harnesses and Responses API agent behavior needs-review PR is ready for code review and waiting on a reviewer labels Nov 29, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 30, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Dec 1, 2026

This branch has not been deployed

No deployments
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 community-request Issue reported or requested by someone from the community needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high sla:triage-overdue Review assignment is over the one-business-day SLA waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

token capture: terminal attribution misses OpenCode answers split from a Gym reply's reasoning block

2 participants