openclaw - 💡(How to fix) Fix [Bug]: `openclaw infer model run` exits 0 when provider returns empty output with usage-limit error [1 pull requests]

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…

openclaw infer model run exits with code 0 when the provider returns empty output and an errorMessage (e.g. ChatGPT-Team usage-limit), instead of a non-zero exit code.

Error Message

$ openclaw infer model run --model openai/gpt-5.5 --prompt "pong" Error: No text output returned for provider "openai" model "gpt-5.5": You have hit your ChatGPT usage limit (team plan). Try again in ~42 min.. $ echo $? 0

Root Cause

openclaw infer model run exits with code 0 when the provider returns empty output and an errorMessage (e.g. ChatGPT-Team usage-limit), instead of a non-zero exit code.

Fix Action

Fixed

Code Example

$ openclaw infer model run --model openai/gpt-5.5 --prompt "pong"
Error: No text output returned for provider "openai" model "gpt-5.5": You have hit your ChatGPT usage limit (team plan). Try again in ~42 min..
$ echo $?
0

---
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

openclaw infer model run exits with code 0 when the provider returns empty output and an errorMessage (e.g. ChatGPT-Team usage-limit), instead of a non-zero exit code.

Steps to reproduce

  1. Authenticate openclaw against an openai provider whose ChatGPT-Team account is at usage limit.
  2. Run openclaw infer model run --model openai/gpt-5.5 --prompt "pong".
  3. Check echo $? after the command returns.

Expected behavior

Non-zero exit code, since the inference failed and No text output returned was printed to stderr. Static reading of cli-utils-*.js (runCommandWithRuntimeruntime.exit(1)process.exit(1)) suggests exit 1 should be produced.

Actual behavior

$ openclaw infer model run --model openai/gpt-5.5 --prompt "pong"
Error: No text output returned for provider "openai" model "gpt-5.5": You have hit your ChatGPT usage limit (team plan). Try again in ~42 min..
$ echo $?
0

OpenClaw version

2026.5.12 (f066dd2)

Operating system

Ubuntu 24.04

Install method

npm global

Model

openai/gpt-5.5

Provider / routing chain

openclaw -> openai (direct, ChatGPT-Team OAuth)

Additional provider/model setup details

Static reading of capability-cli-*.js shows the throw at the "No text output returned" site. Locally exercisable failure paths (unknown model, empty prompt) do return exit 1 correctly. The discrepancy appears specific to the provider-returns-empty-output-with-errorMessage path (observed with openai/gpt-5.5 under ChatGPT-Team auth; would expect same behavior under anthropic/* cooldown but not reproducible at the time of follow-up investigation).

Logs, screenshots, and evidence

Impact and severity

Affected: any scriptable workflow that branches on openclaw infer model run exit code. Severity: medium (silent failure of inference is misleading for automation, but interactive use still shows the error on stderr). Frequency: deterministic when provider returns empty output with usage-limit errorMessage. Consequence: shell pipelines that rely on exit code treat the call as success even when no inference occurred.

Additional information

Suggestion: ensure the provider-returns-empty-output-with-errorMessage path propagates exit 1 (consistent with the existing unknown-model / empty-prompt paths), or add a --strict / --fail-on-error flag that forces non-zero exit.

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

Non-zero exit code, since the inference failed and No text output returned was printed to stderr. Static reading of cli-utils-*.js (runCommandWithRuntimeruntime.exit(1)process.exit(1)) suggests exit 1 should be produced.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: `openclaw infer model run` exits 0 when provider returns empty output with usage-limit error [1 pull requests]