Repository navigation
fix: normalize the content-filter finish reason (WI-1801) - #423
Merged
Merged
Conversation
Fantasy emits the canonical finish reason "content-filter", but the agent loop classified only "content_filter". A filtered response fell through to done (or empty when it carried no text), bypassing the review warning and failed-run contract. Normalize provider finish reasons to this package's spelling at the adapter boundary, alongside the existing tool-calls mapping, so the loop and every StopReason consumer read one form.
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.
Fantasy emits the canonical finish reason
content-filter, but the agent loop'sfinalStopReasonclassified onlycontent_filter. A filtered response fell through todone— or toemptywhen it carried no text — bypassing the review warning and the failed-run contract.Change
Normalize provider finish reasons to this package's spelling at the adapter boundary, alongside the existing
tool-callsmapping, using Fantasy's constants as the source of truth:The loop and every
StopReasonconsumer now read one form.Tests
Windshiftapp/core-tests-internal#23 — adapter-to-loop coverage for a filtered response with and without partial text. Fails against the pre-fix code with
adapter finish reason = "content-filter", want "content_filter".