Function calling with json_schema format can continually loop in api & playground

To give an example of this issue, I managed to replicate it in a basic form in the OpenAI playground.

  • Model: gpt-4.1-mini-2025-04-14
  • Variables: none
  • Tools: get_weather (The stock example in playground)
{
  "name": "get_weather",
  "description": "Determine weather in my location",
  "strict": true,
  "parameters": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "The city and state e.g. San Francisco, CA"
      },
      "unit": {
        "type": "string",
        "enum": [
          "c",
          "f"
        ]
      }
    },
    "additionalProperties": false,
    "required": [
      "location",
      "unit"
    ]
  }
}
  • Tool choice: auto
  • Temp : 1.0

Json Schema, I used the “Generate” button to create this.

{
  "name": "weather_variables",
  "strict": true,
  "schema": {
    "type": "object",
    "properties": {
      "temperature_celsius": {
        "type": "number",
        "description": "Current air temperature in degrees Celsius."
      },
      "humidity_percent": {
        "type": "number",
        "description": "Relative humidity as a percentage (0-100).",
        "minimum": 0,
        "maximum": 100
      },
      "wind_speed_kph": {
        "type": "number",
        "description": "Wind speed in kilometers per hour.",
        "minimum": 0
      },
      "pressure_hpa": {
        "type": "number",
        "description": "Atmospheric pressure in hectopascals (hPa)."
      },
      "precipitation_mm": {
        "type": "number",
        "description": "Precipitation in the past hour in millimeters.",
        "minimum": 0
      },
      "condition": {
        "type": "string",
        "description": "Textual description of the current weather condition (e.g., clear, cloudy, rain, snow).",
        "minLength": 2,
        "maxLength": 32
      }
    },
    "required": [
      "temperature_celsius",
      "humidity_percent",
      "wind_speed_kph",
      "pressure_hpa",
      "precipitation_mm",
      "condition"
    ],
    "additionalProperties": false
  }
}

Now I gave it a confusing line to process.

  1. Get me the weather
  2. Get me the weather in Dorstone
  3. Get me the pothole weather in dorstone
  4. I need the pothole weather in dorstone
  5. but specifically the pothole weather
  6. get the weather

(Then it just endlessly looped) this repsonse.

{"temperature_celsius":21,"humidity_percent":55,"wind_speed_kph":13,"pressure_hpa":1015,"precipitation_mm":0,"condition":"clear"}

Any ideas? Bug or something to note. Happens with API calling too.

Similar happened to me when using structured output, (strict: true) using the web search tool.
But it was not persistent at that time.