{{ message }}
fix(core): fail content-filtered and outputless length settlements - #46602
Closed
clopca wants to merge 1 commit into
Closed
fix(core): fail content-filtered and outputless length settlements#46602clopca wants to merge 1 commit into
clopca wants to merge 1 commit into
Conversation
Steps ending in content_filtered, or in max_tokens without any text or tool call, settled as succeeded with empty output. Users saw blank responses recorded as success, and the terminal filtered segment stayed in history, causing subsequent generations on the session to return empty text as well. Session generate now raises ContentPolicyError on content-filter and InvalidProviderOutputError on outputless length. The runner publisher tracks useful output (text or tool call) separately from durable output: reasoning-only length keeps its reasoning and rawFinish for diagnosis but settles as provider.invalid-output, while truncated responses with partial text remain successful.
Contributor
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
6 tasks
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.

Issue for this PR
Closes #46596
Type of change
What does this PR do?
Steps ending in
content_filtered, or inmax_tokenswithout any text or tool call, settled as succeeded with empty output. Users saw blank responses recorded as success, and the terminal filtered segment stayed in history, causing subsequent generations on the session to return empty text as well.Two changes:
session.generateraisesContentPolicyErroroncontent-filterandInvalidProviderOutputErroronlengthwith no text/tool call, instead of returning empty text with HTTP 200.lengthkeeps its reasoning andrawFinishfor diagnosis but settles asprovider.invalid-output. Truncated responses with partial text remain successful, so no valid output is lost.How did you verify your code works?
session-generate.test.ts(content-filter, output-less length, partial text) andsession-runner-tool-events.test.ts(reasoning-only length settlement).packages/coresuite green (4,106 tests, 0 fail).content_filterednow returns a visible 503 (Provider blocked the response) instead of a silent empty success; healthy sessions and the same history with the filtered segment removed still respond normally.