#2696·instructor

Parallel tools silently drop unknown tool_call names (incomplete results)

Author: michaelkillgtaCreated Sep 25, 2026Updated Sep 25, 2026

Description

Parallel tools handlers silently drop unrecognized tool_call names. The same response that ParallelBase.from_response would KeyError on is instead returned as a truncated list with no ResponseParsingError.

A model typo / hallucinated extra tool therefore vanishes from the result — incomplete structured output with no error.

Environment

  • instructor==1.17.0
  • Python 3.13

Minimal repro

python
# Conceptually (see hunt repro for exact handler wiring):
# Response contains tool_calls: Weather, BogusTool, TimeQuery
# OpenAIToolsHandler / PARALLEL_TOOLS parse:
#   if name in type_registry: yield ...
# → returns [Weather(...), TimeQuery(...)]  # BogusTool dropped silently
# ParallelBase.from_response(...):
#   self.registry[name]  → KeyError: 'BogusTool'

Observed:

handler results (BogusTool dropped): [Weather(...), TimeQuery(...)]
ParallelBase KeyError as expected: 'BogusTool'

Expected

Unknown tool names should raise a clear parsing / validation error (consistent with ParallelBase), not be skipped.

Actual

Handler path silently truncates; ParallelBase KeyErrors — inconsistent and easy to miss in production.

Root cause (pointer)

instructor/v2/providers/openai/handlers.py — OpenAIToolsHandler.parse_response parallel branch and OpenAIParallelToolsHandler.parse_response use if name in type_registry: yield .... Contrast instructor/v2/dsl/parallel.py ParallelBase.from_response which indexes the registry directly.

Related but different: open #2674 (custom schema titles vs __name__ registry mismatch). This issue is silent skip of unknown names even when titles match.

Suggested fix direction

Fail closed on unknown tool names (raise ResponseParsingError / similar) so parallel parsing matches ParallelBase behavior.