#2705·instructor

RESPONSES_TOOLS returns a parsed model when the provider flagged the turn incomplete

Author: feiiiiii5Created Sep 26, 2026Updated Sep 28, 2026

Mode.RESPONSES_TOOLS returns a fully parsed model even when the Responses API says the turn was cut short.

OpenAIResponsesToolsHandler.parse_response (instructor/v2/providers/openai/handlers.py) walks response.output, finds the first function_call with arguments, and returns the validated model. It never looks at response.status or response.incomplete_details:

python
# Handle Responses API format - output is a list of items
if hasattr(response, "output"):
    for item in response.output:
        ...
                        return self._finalize_parsed_result(response_model, response, parsed)

grep -rn "incomplete_details" instructor/v2/providers/openai/ finds nothing.

Every sibling handler does check, several with a comment naming it:

  • _parse_json_response (serves JSON and JSON_SCHEMA) — # Check for incomplete output
  • Mode.TOOLS and Mode.PARALLEL_TOOLS
  • Mode.MD_JSON
  • the mistral and anthropic handlers

The contract is also written down twice: instructor/v2/core/function_calls.py has _handle_incomplete_output ("Check if a completion was incomplete and raise appropriate exception") and instructor/v2/core/errors.py documents IncompleteOutputException as "The output is incomplete due to a max_tokens length limit", with errors.py:152 telling users to catch it and switch to streaming with Partial models.

The handler also opts into the signal itself: it rewrites max_tokens to max_output_tokens (handlers.py:1082-1084), which is the Responses API's own truncation flag. The SDK type is status: Literal["completed","failed","in_progress","cancelled","queued","incomplete"] with incomplete_details.reason: Literal["max_output_tokens","content_filter"].

What the caller sees

A Responses object with status="incomplete", incomplete_details.reason="max_output_tokens", and one complete function_call in output — the tool call closed, then the model kept generating and hit the ceiling. With response_model=User, the caller gets User(name="Ada", age=36) with no exception, and nothing in the returned value says the provider flagged the turn. With cache=..., store_cached_response persists that value.

The question

Is status="incomplete" supposed to reach the caller as IncompleteOutputException for the Responses API, the way it does for the other modes? If yes, this looks like a straight omission and I can send the guard plus a test in the style of the sibling handlers. If the Responses API is meant to behave differently here, I would rather not guess — in that case could you say what should happen instead?

No test in tests/test_openai_responses_tools.py or tests/v2/test_openai_responses_client.py mentions incomplete, truncat, max_output_tokens or finish_reason, so nothing currently pins the behaviour either way.