---
type: email
from: Deniz Özdemirli  <notifications@github.com>
subject: Re: [openai/openai-agents-python] openai.BadRequestError with

 gpt-oss-120b - Expected 2 output messages (reasoning and final), but got 3.

 (Issue #1468)
received: 2026-03-05 10:05:19
date_header: Thu, 14 Aug 2025 01:51:49 -0700
priority: normal
status: awaiting_approval
uid: 27559
---

## Email Content

**From:** Deniz Özdemirli  <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] openai.BadRequestError with

 gpt-oss-120b - Expected 2 output messages (reasoning and final), but got 3.

 (Issue #1468)
**Date:** Thu, 14 Aug 2025 01:51:49 -0700

### Body (preview)

02deno left a comment (openai/openai-agents-python#1468)



Thanks for helping. I removed the output_type parameter from all agents but error is still the same. Also simplest code example works fine. This the result of it : 







DEBUG:openai._base_client:request_id: None

DEBUG:openai.agents:LLM resp:

{

  "content": "**Recursion** is a programming technique where a function calls **itself** to solve a problem that can be broken down into smaller, similar sub‑problems.\n\n---\n\n### Core Concepts\n| Concept | What it means |\n|---------|---------------|\n| **Recursive call** | The function invokes itself with a simpler input. |\n| **Base case** | A condition that stops the recursion (prevents infinite loops). |\n| **Progress towards base case** | Each call must move toward the base case, usually by reducing the problem size. |\n| **Call stack** | Each recursion creates a new stack frame; when the base case is reached, frames unwind and return values. |\n\n---\n\n### Simple Example (Factorial)\n\n```python\ndef factorial(n):\n    if n == 0:               # base case\n        return 1\n    return n * factorial(n-1)   # recursive step\n```\n\n*`factorial(5)` → 5 × factorial(4) → … → 5 × 4 × 3 × 2 × 1 = 120.*\n\n---\n\n### When to Use Recursion\n- **Natural hierarchical structures**: trees, graphs, file systems.\n- **Divide‑and‑conquer algorithms**: quicksort, mergesort, binary search.\n- **Mathematical definitions**: Fibonacci numbers, combinatorial calculations.\n- **Problems where the solution mirrors the problem’s definition**.\n\n---\n\n### Advantages\n- **Expressiveness** – often leads to clearer, shorter code that matches the problem’s logical definition.\n- **Ease of implementation** for inherently recursive data (e.g., traversing a binary tree).\n\n### Drawbacks\n- **Memory overhead** – each call consumes stack space; deep recursion can cause a **stack overflow**.\n- **Performance** – repeated work (e.g., naïve Fibonacci) can be exponential unless memoized

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
