openclaw - 💡(How to fix) Fix [Bug]: [Bug]: agent completes with payloads [] and zero usage on custom OpenAI-compatible provider [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#51036Fetched 2026-04-08 01:05:14
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

OpenClaw agent runs complete successfully but return payloads: [] and zero usage when configured to use a working custom OpenAI-compatible provider (newapi/gpt-5.4).

Root Cause

The agent should return a non-empty assistant payload, for example ok, because the same provider/model returns normal assistant content when called directly with curl.

Code Example

Direct provider test succeeds:

`curl -sS "$OPENAI_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "messages": [{"role": "user", "content": "reply only: ok"}]
  }'`

Observed response included assistant content `"ok"`.

Observed OpenClaw agent result:

`openclaw agent --local --session-id repro --message "reply only: ok" --thinking off --json`

Returned:

- `payloads: []`
- `stopReason: "stop"`
- `lastCallUsage.input = 0`
- `lastCallUsage.output = 0`
- `lastCallUsage.total = 0`
- `provider = "newapi"`
- `model = "gpt-5.4"`

Observed on both:
- `openclaw agent --local ...`
- `openclaw agent ...`

The same behavior also reproduced in a blank profile with an isolated workspace.
A sanitized analysis pack is available.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

OpenClaw agent runs complete successfully but return payloads: [] and zero usage when configured to use a working custom OpenAI-compatible provider (newapi/gpt-5.4).

Steps to reproduce

  1. Configure a custom provider newapi with base URL https://newapi.723733.xyz/v1, API mode openai-chat, and model newapi/gpt-5.4.
  2. Verify the provider works directly with curl against /v1/chat/completions.
  3. Run: openclaw agent --local --session-id repro --message "reply only: ok" --thinking off --json
  4. Observe that the command completes, but payloads is empty and lastCallUsage.total is 0.

Expected behavior

The agent should return a non-empty assistant payload, for example ok, because the same provider/model returns normal assistant content when called directly with curl.

Actual behavior

The command completes with status ok, but returns payloads: []; stopReason is stop; and lastCallUsage.input/output/total are all 0.

OpenClaw version

2026.3.13 (61d171a)

Operating system

WSL Ubuntu on Windows 11

Install method

npm global

Model

newapi/gpt-5.4

Provider / routing chain

openclaw -> newapi -> custom OpenAI-compatible endpoint

Additional provider/model setup details

Provider name is newapi. Base URL is https://newapi.723733.xyz/v1. Provider API mode is openai-chat. All newapi model entries in models.json were changed from openai-responses to openai-chat. The same provider/model works correctly when called directly via curl against /v1/chat/completions. Legacy Kiro / anthropic / apiyi config was removed before reproducing this issue. The issue still reproduces after upgrading from 2026.3.8 to 2026.3.13.

Logs, screenshots, and evidence

Direct provider test succeeds:

`curl -sS "$OPENAI_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "messages": [{"role": "user", "content": "reply only: ok"}]
  }'`

Observed response included assistant content `"ok"`.

Observed OpenClaw agent result:

`openclaw agent --local --session-id repro --message "reply only: ok" --thinking off --json`

Returned:

- `payloads: []`
- `stopReason: "stop"`
- `lastCallUsage.input = 0`
- `lastCallUsage.output = 0`
- `lastCallUsage.total = 0`
- `provider = "newapi"`
- `model = "gpt-5.4"`

Observed on both:
- `openclaw agent --local ...`
- `openclaw agent ...`

The same behavior also reproduced in a blank profile with an isolated workspace.
A sanitized analysis pack is available.

Impact and severity

Affected: local OpenClaw agent runs using this custom provider setup Severity: High (blocks agent replies) Frequency: always in observed tests Consequence: agent commands complete without producing any assistant payload

Additional information

Last known tested bad version: 2026.3.8 Still bad in: 2026.3.13

A blank isolated profile was also tested:

openclaw --profile blank agent --local --session-id blank-test --message "reply only: ok" --thinking off --json

Observed result was still:

  • payloads: []
  • zero usage

In the blank profile, OpenClaw still auto-injected bootstrap/workspace files such as AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md, and BOOTSTRAP.md into the workspace path.

Sanitized config/log bundle: openclaw_analysis_pack.tar.gz

extent analysis

Fix Plan

To resolve the issue of the OpenClaw agent returning an empty payloads array and zero usage when configured to use a custom OpenAI-compatible provider, follow these steps:

  • Update the models.json file to ensure that the newapi/gpt-5.4 model is correctly configured for the openai-chat API mode.
  • Verify that the newapi provider is properly set up with the correct base URL and API key.
  • Check the OpenClaw agent logs for any errors or warnings that may indicate a problem with the provider or model configuration.

Example code to update the models.json file:

{
  "models": {
    "newapi/gpt-5.4": {
      "apiMode": "openai-chat",
      "baseUrl": "https://newapi.723733.xyz/v1",
      "apiKey": "YOUR_API_KEY_HERE"
    }
  }
}

Verification

To verify that the fix worked, run the OpenClaw agent with the --local and --json flags and check the output for a non-empty payloads array and non-zero usage:

openclaw agent --local --session-id repro --message "reply only: ok" --thinking off --json

Look for the following output:

{
  "payloads": ["ok"],
  "stopReason": "stop",
  "lastCallUsage": {
    "input": 1,
    "output": 1,
    "total": 1
  }
}

Extra Tips

  • Make sure to replace YOUR_API_KEY_HERE with your actual API key.
  • If you are still experiencing issues, try checking the OpenClaw agent logs for any errors or warnings.
  • You can also try running the OpenClaw agent with the --verbose flag to get more detailed output.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The agent should return a non-empty assistant payload, for example ok, because the same provider/model returns normal assistant content when called directly with curl.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING