FIX Preserve TAP score and response lineage - #2450
Merged
Roman Lutz (romanlutz) merged 4 commits intoAug 22, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 46481822-e245-4210-bff5-eb1ba1fc0e9b
hannahwestra25
approved these changes
Aug 21, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 46481822-e245-4210-bff5-eb1ba1fc0e9b
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.
Description
TAP can reuse surviving nodes across depths. If a later scorer fails, stale per-turn state could leave an earlier score attached to the node while result construction returned the conversation's later, unscored response. This made the reported response and score describe different turns.
This change resets outcome state before each reused-node execution, rejects empty objective-score results, and excludes failed reused nodes from pruning. Result construction now resolves the assistant response identified by the selected score, including
original_prompt_idlineage used by duplicated TAP branches, instead of blindly returning the final conversation message.The updated docstrings clarify that TAP selects the highest-scoring eligible node on the current frontier, retains the prior valid selection if a later frontier fails completely, and then resolves that already-selected score to its exact response.
Tests and Documentation
Added regression coverage for later scorer failures, empty objective-score results, pruning failed reused nodes, terminal score-response identity, and duplicated-conversation lineage.
Validated the multi-turn attack suite (372 passed), affected scenario tests (101 passed), Ruff, type checking, commit hooks, and
git diff --check. JupyText was not applicable.