Skip to content

Conversation

kuntal1461
Copy link

DeepResearch could return an empty ResponseFunctionWebSearch.action
after maxToolCalls was reached, causing downstream handlers to see an
empty action and produce no results.

This change adds a safe fallback path once the tool-call budget is
exhausted and guarantees a non-empty, well-formed action. It also
documents the invariant and adds a regression test that simulates
exceeding maxToolCalls.

  • Ensure non-empty action structure post-budget
  • Add guard + explicit fallback for exhausted budget
  • Add test: exceedsMaxToolCalls_returnsFallbackAction

Why:
Prevents silent empty responses during multi-call DeepResearch flows
and makes behavior deterministic at the tool-call boundary.

Fixes: #600

… exceeding maxToolCalls (openai#600)

Ensure proper fallback and non-empty response handling when tool limit is exceeded.
This prevents returning empty responses during DeepResearch multi-call sequences.
@kuntal1461 kuntal1461 requested a review from a team as a code owner October 7, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeepResearch returns empty ResponseFunctionWebSearch.action after exceeding maxToolCalls
1 participant