Skip to content

Conversation

@jwangxx
Copy link
Contributor

@jwangxx jwangxx commented Jul 30, 2025

This was resulting in users getting stuck in a state where, after one prompt that triggered an RAI 422 error, all their subsequent requests were being filtered.

…ed due to prompt filtration. This was resulting in users getting stuck in a state where all their subsequent requests were being filtered.
…response-filtered requests should be rendered in the message history whereas prompt-filtered requests should not)
@jwangxx jwangxx force-pushed the exclude-filtered-turns branch from 379934e to 18b8b46 Compare July 30, 2025 15:12
override render(_state: void, _sizing: PromptSizing): PromptPiece<any, any> | undefined {
let turnHistory = this.props.history;
// exclude turns from the history that errored due to prompt filtration
let turnHistory = this.props.history.filter(turn => turn.responseStatus !== TurnStatus.PromptFiltered);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below there's a check in the forEach loop for Filtered responses, would a similar approach work for prompt filtered responses?

Copy link
Contributor Author

@jwangxx jwangxx Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the loop below, we are always including the user message and then filtering out the assistant response if it has responseStatus of TurnStatus.Filtered. in contrast, for turns with responseStatus of TurnStatus.PromptFiltered, we don't want the user message included (nor the non-existent assistant response)

@aiday-mar aiday-mar requested a review from roblourens July 30, 2025 15:54
OffTopic = 'offTopic',
Canceled = 'canceled',
Filtered = 'filtered',
PromptFiltered = 'promptFiltered',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new thing? Or we just never handled it before?

Copy link
Member

@roblourens roblourens Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And do you have an example to trigger this? I tried some things and I mostly only get "Sorry I can't assist with this"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm I got it

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@roblourens roblourens enabled auto-merge July 30, 2025 17:37
@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 30, 2025
@roblourens roblourens added this pull request to the merge queue Jul 30, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 30, 2025
@roblourens roblourens added this pull request to the merge queue Jul 30, 2025
Merged via the queue into microsoft:main with commit c62bfff Jul 30, 2025
6 checks passed
@jwangxx jwangxx deleted the exclude-filtered-turns branch July 30, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants