Skip to content

Potential infinite loop in deepsearch #118

@PeterDaveHello

Description

@PeterDaveHello

During deepsearch, the model’s "thinking" output often produces similar variations of the initial query description for 15–20 minutes, while the step count climbs past 100 and the gaps array remains unchanged, consuming hundreds of thousands of tokens without real progress. Most queries are in Chinese, and this behavior has been observed with models like GPT-4.1 and o4-mini.

Example log:

{
  "severity": "DEBUG",
  "message": "Step 100 / Budget used 64.51%",
  "component": "deepsearch",
  "timestamp": "2025-07-14T10:57:14.161Z",
  "gaps": ["xxxx"]
}

A related warning sometimes appears:

{
  "severity": "WARNING",
  "message": "Object not generated according to schema, fallback to manual parsing",
  "component": "deepsearch",
  "timestamp": "2025-07-14T10:57:06.355Z",
  "error": {
    "message": "No object generated: response did not match schema.",
    "name": "AI_NoObjectGeneratedError"
  }
}

These signs suggest the model may be stuck in a loop, failing to close gaps but continuing to iterate. Feedback on whether the warning and loop behavior are connected, and suggestions for a more graceful handling approach, would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions