Repository navigation
fix(opencode): match token capture to the call that produced the scored reply - #6922
Open
yutianjiang39 wants to merge 5 commits into
Open
yutianjiang39 wants to merge 5 commits into
yutianjiang39 wants to merge 5 commits into
Conversation
Signed-off-by: yutianjiang39 <[email protected]>
Signed-off-by: yutianjiang39 <[email protected]>
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]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
checks.json64e3bc70bwith regression tests onlyfocusedsuiteRollouts
In the two-root regression fixture, one call returns
<think>r</think>\n\n4and the other returns4. The verifier still sees4. 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.