Skip to content

openai_agents scaffold: Qwen3.5 thinking mode ends agent runs after one tool call #461

Open

Description

@gregorybchris

The openai_agents scaffold can't run Qwen3.5 with thinking enabled. Every agent run ends after one tool call, which blocks comparing SWE-bench Verified (#445) against the published thinking-on numbers.

What happens

With enable_thinking=true and vLLM's qwen3 reasoning parser, the model works through its first turn normally. On turn 2 it emits its <tool_call> inside a <think> block that it never closes. The reasoning parser returns all of it as reasoning, with tool_calls=[]. The Agents SDK sees a turn with no tool calls and treats it as the final answer. On SWE-bench this gives an empty patch on every instance.

Reported by @pdasigi in the #445 review, from a run with SDK response logging: qwen3.5-9b-swebench-debug-think-v4.

Causes

  1. Field name mismatch. vLLM 0.19.1 returns the reasoning text in message.reasoning, but openai-agents 0.20 only reads reasoning_content. The reasoning is dropped from the conversation.
  2. No reasoning replay. The SDK only replays reasoning on earlier assistant turns for DeepSeek models. For other self-hosted models, earlier turns are sent back with empty think blocks, which appears to push the model into putting its tool call inside a think block.

Proposed fix

Fix this in the shared scaffold (harness/scaffolds/openai_agents.py, alongside patch_openai_agents_for_vllm), not per eval:

  • Map reasoning to reasoning_content on responses from self-hosted OpenAI-compatible servers.
  • Enable reasoning replay across turns for those servers.
  • Add a test with a scripted chat endpoint that returns reasoning plus a tool call over two turns, asserting the second tool call is dispatched.

Once this is fixed, rerun Qwen3.5-9B on SWE-bench Verified with thinking on and compare it with the mini-swe-agent number in the Xiaomi MiMo-V2.6 report (60.6).

Activity

  1. abhishekraok commented on Nov 3, 2026

    @abhishekraok
    Collaborator

    Written by Claude Code session review-388-2bb346

    Investigated; no PR yet. Two findings beyond the issue text:

    • Cause 1 (reasoning vs reasoning_content) is already handled in trajectory-reasoning (Keep model reasoning in the saved agent trajectory #346), which mirrors the field in a model subclass. That PR now conflicts with main.
    • Cause 2 needs more than the SDK's replay hook: openai-agents 0.20 replays reasoning as reasoning_content, but vLLM 0.19.1 reads only reasoning on input assistant messages (chat_utils.py#L1512). Qwen3.5's template renders <think>{reasoning_content}</think> on every assistant turn after the last user message, so without replay those are all empty think blocks, as the issue suspects.

    Proposed fix: on top of #346's subclass, enable replay for self-hosted servers and send it under reasoning; check on a few Qwen3.5-9B SWE-V instances with thinking on. @gregorybchris, OK to take this over, or would you rather drive it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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