openclaw - 💡(How to fix) Fix [cli-backend] Hardcoded CLAUDE_LIVE_MAX_TURN_RAW_CHARS causes silent failures (regression in 2026.4.29) [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#75838Fetched 2026-05-02 05:29:18
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Timeline (top)
commented ×1

Upgrading from v2026.4.23 to v2026.4.29 introduced hardcoded output guards in claude-live-session-*.js that cause FailoverError on tool-heavy Claude CLI turns, particularly with Opus 4.7.

Error Message

[agent/cli-backend] claude live session turn failed: provider=claude-cli model=claude-opus-4-7 durationMs=35070 error=FailoverError

Root Cause

Two hardcoded constants in claude-live-session-*.js:

const CLAUDE_LIVE_MAX_TURN_RAW_CHARS = 2 * 1024 * 1024; // 2MB
const CLAUDE_LIVE_MAX_TURN_LINES = 5000;

When Opus uses tools (file reads, bash commands), the JSONL output can exceed these limits. The session is aborted with FailoverError (reason=format), and if no fallback is configured, the user gets no response.

Fix Action

Workaround

Adding a fallback model in agents.defaults.model.fallbacks catches the failures instead of silently dropping them.

Code Example

const CLAUDE_LIVE_MAX_TURN_RAW_CHARS = 2 * 1024 * 1024; // 2MB
const CLAUDE_LIVE_MAX_TURN_LINES = 5000;

---

[agent/cli-backend] claude live session turn failed: provider=claude-cli model=claude-opus-4-7 durationMs=35070 error=FailoverError
[model-fallback/decision] decision=candidate_failed reason=format detail=Claude CLI turn output exceeded limit. fallbackConfigured=false
RAW_BUFFERClick to expand / collapse

Summary

Upgrading from v2026.4.23 to v2026.4.29 introduced hardcoded output guards in claude-live-session-*.js that cause FailoverError on tool-heavy Claude CLI turns, particularly with Opus 4.7.

Reproduction

  • v2026.4.23: 0 turn output exceeded limit failures
  • v2026.4.29: 8+ failures in the same day, same model, same config
  • Primary model: claude-cli/claude-opus-4-7
  • Fallback was set to none (no recovery path), making failures silent

Root Cause

Two hardcoded constants in claude-live-session-*.js:

const CLAUDE_LIVE_MAX_TURN_RAW_CHARS = 2 * 1024 * 1024; // 2MB
const CLAUDE_LIVE_MAX_TURN_LINES = 5000;

When Opus uses tools (file reads, bash commands), the JSONL output can exceed these limits. The session is aborted with FailoverError (reason=format), and if no fallback is configured, the user gets no response.

Log Evidence

[agent/cli-backend] claude live session turn failed: provider=claude-cli model=claude-opus-4-7 durationMs=35070 error=FailoverError
[model-fallback/decision] decision=candidate_failed reason=format detail=Claude CLI turn output exceeded limit. fallbackConfigured=false

Expected Behavior

The limit should be user-configurable via the cliBackends schema (e.g., a maxTurnRawChars field), or the default should be raised to accommodate tool-heavy agentic turns.

Workaround

Adding a fallback model in agents.defaults.model.fallbacks catches the failures instead of silently dropping them.

Environment

  • OpenClaw: v2026.4.29
  • Model: claude-opus-4-7 via claude-cli
  • OS: Ubuntu Linux
  • Node: v22.22.2

extent analysis

TL;DR

Configure a fallback model in agents.defaults.model.fallbacks to catch failures instead of silently dropping them.

Guidance

  • Identify the current cliBackends schema and consider adding a maxTurnRawChars field to make the limit user-configurable.
  • Review the log evidence to confirm that the FailoverError is caused by exceeding the hardcoded output limits.
  • Consider raising the default values of CLAUDE_LIVE_MAX_TURN_RAW_CHARS and CLAUDE_LIVE_MAX_TURN_LINES to accommodate tool-heavy agentic turns.
  • Test the workaround by adding a fallback model and verifying that failures are no longer silent.

Example

No code snippet is provided as it is not necessary for this issue, but an example of adding a fallback model could be:

// agents.defaults.model.fallbacks
{
  "fallbacks": [
    {
      "model": "claude-opus-4-7-fallback",
      "weight": 1.0
    }
  ]
}

Notes

The provided workaround only catches failures and does not address the root cause of the issue. A more permanent solution would involve making the output limits user-configurable or raising the default values.

Recommendation

Apply the workaround by configuring a fallback model, as it provides a temporary solution to prevent silent failures.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING