openclaw - 💡(How to fix) Fix Surface raw provider errors in UI/logs when OpenClaw rewrites assistant error text [1 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#55451Fetched 2026-04-08 01:39:24
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

When a provider error occurs, OpenClaw can preserve the raw provider message in the session transcript while showing a much less useful message in the Control UI / operator-facing surfaces.

In today's incident, a long-lived Discord thread on openai/gpt-5.4 hit an OpenAI TPM limit. The transcript preserved the full provider error:

Rate limit reached for gpt-5.4 ... on tokens per min (TPM): Limit 500000, Used 375783, Requested 170059. Please try again in 5.501s.

But the operator-facing experience did not surface that actionable detail. That cost a lot of debugging time because the UI/log view looked generic enough to suggest a broader outage rather than a concrete TPM failure.

This feels like the wrong tradeoff for operator surfaces. Friendly end-user copy is fine, but the raw provider error should still be visible somewhere obvious.

Error Message

Draft GitHub Issue — Surface raw provider errors in UI/logs when OpenClaw rewrites assistant error text

When a provider error occurs, OpenClaw can preserve the raw provider message in the session transcript while showing a much less useful message in the Control UI / operator-facing surfaces. In today's incident, a long-lived Discord thread on openai/gpt-5.4 hit an OpenAI TPM limit. The transcript preserved the full provider error: This feels like the wrong tradeoff for operator surfaces. Friendly end-user copy is fine, but the raw provider error should still be visible somewhere obvious.

  • stopReason: "error" When a provider returns a concrete error message (especially for rate limits, auth failures, billing failures, or request rejections), OpenClaw should do both:
  1. preserve and surface the raw provider error in an obvious operator-visible place
  • visible expandable “raw provider error” block in Control UI A raw provider error often immediately answers: In this case, surfacing the raw TPM error would have saved roughly 45 minutes of unnecessary incident triage.
  • embedded run payload building appears to prefer a friendly/safe error string instead of always exposing the raw provider message Add a raw provider error field alongside friendly text wherever final run errors are surfaced.
  • raw provider error
  • compare transcript error fields against UI behavior
  • normal chat surfaces → friendly error only
  • operator/admin/control surfaces → friendly error + raw provider diagnostics

Root Cause

For operators, these are not cosmetic details.

A raw provider error often immediately answers:

  • was this rate-limit vs outage vs auth vs billing?
  • was it request-size / TPM / RPM?
  • what cooldown did the provider recommend?
  • was there a request id to correlate upstream?

In this case, surfacing the raw TPM error would have saved roughly 45 minutes of unnecessary incident triage.

Fix Action

Fix / Workaround

Workaround today

Current workaround is ugly:

  • inspect session .jsonl artifacts directly
  • compare transcript error fields against UI behavior
  • infer the real cause manually
RAW_BUFFERClick to expand / collapse

Draft GitHub Issue — Surface raw provider errors in UI/logs when OpenClaw rewrites assistant error text

Summary

When a provider error occurs, OpenClaw can preserve the raw provider message in the session transcript while showing a much less useful message in the Control UI / operator-facing surfaces.

In today's incident, a long-lived Discord thread on openai/gpt-5.4 hit an OpenAI TPM limit. The transcript preserved the full provider error:

Rate limit reached for gpt-5.4 ... on tokens per min (TPM): Limit 500000, Used 375783, Requested 170059. Please try again in 5.501s.

But the operator-facing experience did not surface that actionable detail. That cost a lot of debugging time because the UI/log view looked generic enough to suggest a broader outage rather than a concrete TPM failure.

This feels like the wrong tradeoff for operator surfaces. Friendly end-user copy is fine, but the raw provider error should still be visible somewhere obvious.

Environment

  • OpenClaw: 2026.3.24
  • Platform: macOS 26.3.1 (arm64)
  • Node: 25.6.1
  • Active model at failure: openai/gpt-5.4
  • API path: OpenAI Responses
  • Surface in use: Discord thread lanes + Webchat / Control UI

Concrete case

Affected session artifact showed:

  • contextTokens: 272000
  • totalTokens: 166009
  • transcript assistant message with:
    • stopReason: "error"
    • errorMessage: "Rate limit reached for gpt-5.4 in organization ... on tokens per min (TPM): Limit 500000, Used 375783, Requested 170059. Please try again in 5.501s. ..."

This exact provider detail was available in the transcript/session artifact but was not surfaced clearly enough in the operator-facing experience.

Expected behavior

When a provider returns a concrete error message (especially for rate limits, auth failures, billing failures, or request rejections), OpenClaw should do both:

  1. provide a friendly user-facing summary if desired
  2. preserve and surface the raw provider error in an obvious operator-visible place

Good examples:

  • visible expandable “raw provider error” block in Control UI
  • operator log line including the raw provider message and request id
  • lifecycle/event payload carrying both:
    • friendlyError
    • rawProviderError

Actual behavior

  • transcript/session artifact preserved the actionable TPM string
  • operator-facing UI/log experience did not surface that same detail clearly
  • result: debugging started from a misleadingly generic symptom instead of the real provider failure

Why this matters

For operators, these are not cosmetic details.

A raw provider error often immediately answers:

  • was this rate-limit vs outage vs auth vs billing?
  • was it request-size / TPM / RPM?
  • what cooldown did the provider recommend?
  • was there a request id to correlate upstream?

In this case, surfacing the raw TPM error would have saved roughly 45 minutes of unnecessary incident triage.

Likely relevant implementation area

From local inspection of the installed bundle, it appears OpenClaw intentionally rewrites some assistant errors into friendly/safe copy before emitting them to UI-facing payloads.

Examples observed locally in the bundled runtime:

  • recognized rate-limit errors can be rewritten to:
    • ⚠️ API rate limit reached. Please try again later.
  • embedded run payload building appears to prefer a friendly/safe error string instead of always exposing the raw provider message

That seems reasonable for end-user polish, but there should still be an operator-visible raw field.

Suggested fix

Minimum acceptable fix

Add a raw provider error field alongside friendly text wherever final run errors are surfaced.

For example:

  • friendlyError: ⚠️ API rate limit reached. Please try again later.
  • rawProviderError: Rate limit reached for gpt-5.4 ... Limit 500000, Used 375783, Requested 170059. Please try again in 5.501s.

Better fix

In Control UI, render:

  • friendly summary by default
  • collapsible diagnostics section with:
    • raw provider error
    • provider/model
    • response/request id if present
    • HTTP status if known

Related issues

Possibly adjacent / same family:

  • #54417 — Subagent errors (e.g. 429 Rate Limit) are not surfaced to user, messages appear to be swallowed
  • #48603 — [Feature]: API rate limit reached. Please try again later.
  • #36142 — Silent empty response when LLM rate limit hits mid-turn (after tool calls)

Workaround today

Current workaround is ugly:

  • inspect session .jsonl artifacts directly
  • compare transcript error fields against UI behavior
  • infer the real cause manually

That is workable for forensics, but it is not acceptable as the primary operator experience.

Nice-to-have

If OpenClaw wants to keep end-user surfaces clean, consider a config/role split such as:

  • normal chat surfaces → friendly error only
  • operator/admin/control surfaces → friendly error + raw provider diagnostics

extent analysis

Fix Plan

To address the issue, we will implement the following steps:

  • Add a rawProviderError field to the error payload alongside the friendlyError field.
  • Update the Control UI to render a collapsible diagnostics section with the raw provider error, provider/model, response/request id, and HTTP status.

Code Changes

// Update error payload to include rawProviderError
const errorPayload = {
  friendlyError: 'API rate limit reached. Please try again later.',
  rawProviderError: 'Rate limit reached for gpt-5.4 ... Limit 500000, Used 375783, Requested 170059. Please try again in 5.501s.',
};

// Update Control UI to render collapsible diagnostics section
const DiagnosticsSection = () => {
  return (
    <div>
      <h4>Diagnostics</h4>
      <p>Raw Provider Error: {errorPayload.rawProviderError}</p>
      <p>Provider/Model: {providerModel}</p>
      <p>Response/Request ID: {responseRequestId}</p>
      <p>HTTP Status: {httpStatus}</p>
    </div>
  );
};

Configuration Changes

Consider adding a config/role split to display friendly errors only on normal chat surfaces and friendly errors + raw provider diagnostics on operator/admin/control surfaces.

Infra/Dependency Fixes

No infra/dependency fixes are required for this solution.

Verification

To verify the fix, test the following scenarios:

  • API rate limit error: Verify that the raw provider error is displayed in the Control UI diagnostics section.
  • Auth failure error: Verify that the raw provider error is displayed in the Control UI diagnostics section.
  • Billing failure error: Verify that the raw provider error is displayed in the Control UI diagnostics section.

Extra Tips

  • Consider implementing a logging mechanism to store raw provider errors for future debugging purposes.
  • Review related issues (#54417, #48603, #36142) to ensure that similar errors are handled consistently.

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

When a provider returns a concrete error message (especially for rate limits, auth failures, billing failures, or request rejections), OpenClaw should do both:

  1. provide a friendly user-facing summary if desired
  2. preserve and surface the raw provider error in an obvious operator-visible place

Good examples:

  • visible expandable “raw provider error” block in Control UI
  • operator log line including the raw provider message and request id
  • lifecycle/event payload carrying both:
    • friendlyError
    • rawProviderError

Still need to ship something?

×6

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

Back to top recommendations

TRENDING