Skip to content

[Bug]: Custom OpenAI-compatible provider returns valid assistant content, but embedded agent ends with payloads=0 / "Agent couldn't generate a response" #69410

@Greensports4810

Description

@Greensports4810

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

With a custom OpenAI-compatible provider, OpenClaw receives a valid assistant response from the backend, but the embedded agent still ends the turn with payloads=0 and shows “Agent couldn't generate a response.”

Steps to reproduce

  1. Configure a custom OpenAI-compatible provider in ~/.openclaw/openclaw.json pointing to a local proxy/backend.
  2. Ensure the backend returns a valid assistant response for both /v1/completions and /v1/chat/completions.
  3. Start the gateway:
    openclaw gateway --bind lan
  4. Run:
    openclaw agent --agent main --message "Antworte nur mit OK"
  5. Observe that the backend logs a valid assistant response (OK), but OpenClaw ends with:
    Agent couldn't generate a response. Please try again.
  6. Confirm gateway log shows:
    incomplete turn detected ... payloads=0

Expected behavior

If the custom provider returns a valid assistant chat completion with content "OK", OpenClaw should surface "OK" as the agent reply.

Actual behavior

OpenClaw does not surface the assistant reply. Instead, the turn ends with:

  • incomplete turn detected ... payloads=0
  • Agent couldn't generate a response. Please try again.

OpenClaw version

2026.4.19-beta.1

Operating system

macOS 15.x

Install method

npm install -g openclaw

Model

seppi-llm/mlx-community/Qwen2.5-14B-Instruct-4bit

Provider / routing chain

openclaw -> custom OpenAI-compatible provider -> local proxy -> mlx_lm.server

Additional provider/model setup details

Custom provider configured in ~/.openclaw/openclaw.json.

OpenClaw runs on a Mac mini.
The provider points to a local OpenAI-compatible proxy running on a MacBook Pro:
http://192.168.1.36:47000/v1

The proxy sanitizes incoming OpenClaw chat/completions requests and forwards them to mlx_lm.server.

Backend model:
mlx-community/Qwen2.5-14B-Instruct-4bit

Important observation:
the backend logs the final assistant content ('OK') before OpenClaw reports payloads=0.

Logs, screenshots, and evidence

Gateway log:
[agent/embedded] incomplete turn detected: runId=... sessionId=... stopReason=stop payloads=0 — surfacing error to user
⚠️ Agent couldn't generate a response. Please try again.

CLI output:
openclaw agent --agent main --message "Antworte nur mit OK"
⚠️ Agent couldn't generate a response. Please try again.

Backend log excerpt:
Request received: /v1/chat/completions
Incoming body keys: ['model', 'messages', 'stream', 'store', 'max_completion_tokens', 'tools']
Incoming path: /v1/chat/completions
Sanitized payload keys: ['model', 'messages', 'max_tokens', 'temperature', 'stream']
Sanitized message count: 2
Sanitized max_tokens: 64
Sanitized message 1: role=system content='You are a personal assistant running inside OpenClaw...'
Sanitized message 2: role=user content='[Mon 2026-04-20 13:13 GMT+2] Antworte nur mit OK'
Upstream response keys: ['id', 'system_fingerprint', 'object', 'model', 'created', 'choices', 'usage']
Upstream first choice keys: ['index', 'finish_reason', 'message']
Assistant content preview: 'OK'
Request finished (11.63s)

Direct backend calls to /v1/completions and /v1/chat/completions succeed.

Impact and severity

Affected: Users of custom OpenAI-compatible providers in OpenClaw embedded agent flows.
Severity: High (agent replies are lost even though the backend returns valid assistant content).
Frequency: Reproduced consistently in my setup.
Consequence: The agent does not surface a visible reply and the turn ends with payloads=0.

Additional information

Reproduced on:

  • 2026.3.8
  • 2026.4.14
  • 2026.4.19-beta.1

Direct backend calls succeed, including /v1/completions and /v1/chat/completions.

The backend logs the final assistant content ('OK') before OpenClaw reports payloads=0.

This appears to be an embedded-agent reply assembly / payload extraction issue for custom OpenAI-compatible providers, not a backend inference failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions