[codex] Add truncated reasoning response error#1768
Draft
rasdani wants to merge 1 commit into
Draft
Conversation
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.
Summary
Adds a narrow
TruncatedReasoningErrorfor renderer responses that hitfinish_reason == "length"after emitting reasoning but before producing content or tool calls.The new error subclasses
EmptyModelResponseError, so existing retry/catch behavior remains compatible while downstream logs can distinguish true empty responses from length-truncated reasoning-only responses.Validation
uv run ruff format verifiers/errors.py verifiers/clients/renderer_client.py verifiers/utils/error_utils.py tests/test_renderer_client.py tests/test_error_chain.pyuv run ruff check verifiers/errors.py verifiers/clients/renderer_client.py verifiers/utils/error_utils.py tests/test_renderer_client.py tests/test_error_chain.pyuv run pytest tests/test_renderer_client.py::test_renderer_client_rejects_reasoning_only_native_response tests/test_renderer_client.py::test_renderer_client_rejects_truncated_reasoning_native_response tests/test_error_chain.py::TestErrorChain::test_truncated_reasoning_error_round_tripsPYTHONPATH=/root/git/verifiers; the capped response now classifies asTruncatedReasoningErrorwithfinish_reason=length,content_len=0,tool_call_count=0, andreasoning_len=611.Note
Add
TruncatedReasoningErrorfor responses that hit length limit during reasoningTruncatedReasoningErroras a subclass ofEmptyModelResponseErrorin verifiers/errors.py to distinguish length-truncated reasoning responses from generic empty responses.RendererClient.raise_from_native_responsein renderer_client.py to raiseTruncatedReasoningErrorinstead ofEmptyModelResponseErrorwhen a response hasreasoning_content, no content or tool calls, andfinish_reason == 'length'.TruncatedReasoningErrorinvf_error_typesso it round-trips correctly through error serialization.Macroscope summarized 6808f92.