FIX Recover chat drafts after target processing failures - #2474
Open
Roman Lutz (romanlutz) wants to merge 5 commits into
Open
FIX Recover chat drafts after target processing failures#2474Roman Lutz (romanlutz) wants to merge 5 commits into
Roman Lutz (romanlutz) wants to merge 5 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a69a7e6-c349-4549-9179-3058526d25dc
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a69a7e6-c349-4549-9179-3058526d25dc
Scope chat message assertions to the message list so retained in-flight drafts do not create ambiguous text locators. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a69a7e6-c349-4549-9179-3058526d25dc
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a69a7e6-c349-4549-9179-3058526d25dc
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
PyRIT can persist a failed user turn and an assistant error piece while returning HTTP 200 from the message endpoint. The chat frontend previously treated that resolved request as target success, cleared the composer, and left users without a safe recovery path.
This change separates transport success from target outcome success by inspecting
response_error. For retryableprocessingfailures, the chat preserves the submitted text, attachments, and converter intent and offers Edit in clean conversation instead of automatically resending. Multi-turn targets branch immediately before the failed user turn, while single-turn targets start a fresh conversation. This avoids duplicating persisted turns or replaying diagnostic text into future target context.Blocked and safety outcomes remain non-retryable, rejected HTTP or network sends restore the draft in place, and stale send or recovery completions cannot overwrite newer edits or navigation. Processing diagnostics are also removed from chat content and conversation previews, and internal attachment recovery values are excluded from JSON exports.
The backend's authoritative persisted-error and HTTP-200 behavior remains unchanged.
Before and after
processing-error-before-after-updated.webm
Tests and Documentation