Skip to content

[Bug] Independent agents receive empty responses from OpenAI-compatible providers (yunwu-openai) — input_tokens: 0, content: [] #27509

@Minh810929

Description

@Minh810929

Description

Independent agents (created via openclaw agents add) receive empty responses from OpenAI-compatible proxy providers (e.g., yunwu-openai), while the same provider/model works correctly via sessions_spawn from the main agent.

Environment

  • OpenClaw version: 2026.2.25 (4b5d4a4)
  • OS: macOS (Darwin 25.2.0 arm64)
  • Node: v24.13.0
  • Provider: yunwu-openai (OpenAI-compatible proxy for Gemini models)
  • Models tested: gemini-3.1-pro-preview, gemini-3-flash-preview-nothinking

Steps to Reproduce

  1. Create an independent agent:
    openclaw agents add thoth --model "yunwu-openai/gemini-3.1-pro-preview" \
      --workspace ~/.openclaw/agents/thoth/workspace \
      --agent-dir ~/.openclaw/agents/thoth/agent --non-interactive
  2. Configure Feishu account for the agent, add binding with match.accountId
  3. Copy models.json from main agent to thoth agent dir
  4. Send a message to the agent via Feishu

Expected Behavior

Agent responds with model-generated content.

Actual Behavior

Agent runs successfully (isError=false) but produces replies=0. Session JSONL shows:

{
  "role": "assistant",
  "content": [],
  "provider": "yunwu-openai",
  "model": "gemini-3.1-pro-preview",
  "usage": {
    "input": 0,
    "output": 0
  },
  "stopReason": "stop"
}

Root Cause Analysis

Direct curl test to the same API returns valid content:

{
  "choices": [{"message": {"role": "assistant", "content": "Hello! How can I help you today?"}}],
  "usage": {
    "prompt_tokens": 4,
    "completion_tokens": 222,
    "total_tokens": 226,
    "input_tokens": 0,
    "output_tokens": 0
  }
}

The provider returns two sets of token counts:

  • prompt_tokens / completion_tokens: correct values (4 / 222)
  • input_tokens / output_tokens: always 0

OpenClaw appears to read input_tokens / output_tokens (both 0) and may interpret this as an empty/invalid response, discarding the actual content.

Key Observations

  1. sessions_spawn with the same model works — the main agent can successfully call yunwu-openai/gemini-3.1-pro-preview via subagent
  2. deepseek/deepseek-chat works for independent agents — switching the model to DeepSeek produces normal responses
  3. All yunwu-openai models fail for independent agents (tested gemini-3.1-pro, gemini-3-flash)
  4. The API itself is functional (confirmed via curl)

Workaround

Use non-OpenAI-compatible providers (e.g., deepseek/deepseek-chat, zhihui/claude-opus-4-6) for independent agents.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions