Repository navigation
A reasoning-only answer makes the identical agent retry sample, not replay - #183
Open
AgentSparko wants to merge 2 commits into
Open
AgentSparko wants to merge 2 commits into
AgentSparko wants to merge 2 commits into
Conversation
…eplay An agent client that gets a completion of pure reasoning (finish=stop, no visible content, no tool call) retries by re-sending the byte-identical conversation, whose tail is a tool result. The regenerate detector cannot match it (a user tail is the rule), and greedy decode plus the prefix cache replays the identical degenerate continuation on every retry -- observed three times in a row, request chatcmpl-6d21296b94bb48f5b802af7d. Remember a conversation whose completion was reasoning-only by its retry signature (a user OR tool tail); the next request with that signature samples like a regenerate. A good answer clears the mark, X-Tandem-Regenerate: 0 never matches, and a client that names sampling parameters decides as ever. The classic regenerate path is untouched.
A client that appends a nudge to the retry tail (a user row after the tool result, or a second user row after its prompt) changed the conversation bytes, so the degenerate-retry mark never matched and greedy replay stood. The signature now covers the conversation up to its unanswered anchor - the last tool result, else the first user row of a trailing user run - which is what the retry re-sends under any nudge. Two scenarios added; the classic regenerate path and the off switch are untouched.
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.
An agent client that gets a completion of pure reasoning (finish=stop, no visible content, no tool call) retries by re-sending the byte-identical conversation, whose tail is a tool result.
signaturecannot match it (the rule needs a user tail), and greedy decode + prefix cache replays the identical degenerate continuation on every retry - observed three byte-identical retries in a row (requestchatcmpl-6d21296b94bb48f5b802af7d, 118k prompt, dev-tip build).The fix remembers a conversation whose completion was reasoning-only by its retry signature (a user OR tool tail); the next request with that signature samples like a regenerate. A good answer clears the mark,
X-Tandem-Regenerate: 0never matches, and a client that names sampling parameters decides as ever. The classic regenerate path is untouched.Tests:
tests/test_regenerate_degenerate.py(new, all ok) +tests/test_regenerate.pypair suite (ALL PASS with TANDEMAPP_SRC set).