openclaw - 💡(How to fix) Fix [Bug]: browser open and browser tabs ignore --json flag in 2026.4.26 (output goes to stderr as plain text) [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#74574Fetched 2026-04-30 06:22:50
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Timeline (top)
labeled ×2closed ×1commented ×1

In openclaw 2026.4.26, the global --json flag is silently ignored by browser open and browser tabs. Both subcommands now emit human-readable plain text on stderr instead of JSON on stdout, regardless of the flag.

browser evaluate still emits proper JSON on stdout, which suggests this is specific to the open/tabs handlers, not the --json flag plumbing itself.

This silently broke automation scripts that captured the output for parsing (OUT=$(openclaw browser --json open URL 2>/dev/null); jq -r .targetId <<< "$OUT") because the data is on stderr (discarded by 2>/dev/null) and is no longer JSON anyway.

Root Cause

This silently broke automation scripts that captured the output for parsing (OUT=$(openclaw browser --json open URL 2>/dev/null); jq -r .targetId <<< "$OUT") because the data is on stderr (discarded by 2>/dev/null) and is no longer JSON anyway.

Code Example

Line 351 of dist/browser-cli-manage-DRvjKLfj.js (after npm install):

  defaultRuntime.log(`opened: ${tab.url}\n${tab.tabId ? `tab: ${tab.tabId}\n` : ""}${tab.label ? `label: ${tab.label}\n` : ""}id: ${tab.targetId}`);

  This is an unconditional plain-text emit. The file contains zero references
  to --json, isJson, outputJson, or any conditional formatting — looks
  like the JSON branch was either lost in a refactor or never implemented for
  these two handlers.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

In openclaw 2026.4.26, the global --json flag is silently ignored by browser open and browser tabs. Both subcommands now emit human-readable plain text on stderr instead of JSON on stdout, regardless of the flag.

browser evaluate still emits proper JSON on stdout, which suggests this is specific to the open/tabs handlers, not the --json flag plumbing itself.

This silently broke automation scripts that captured the output for parsing (OUT=$(openclaw browser --json open URL 2>/dev/null); jq -r .targetId <<< "$OUT") because the data is on stderr (discarded by 2>/dev/null) and is no longer JSON anyway.

Steps to reproduce

openclaw browser --json open about:blank 1>/tmp/stdout 2>/tmp/stderr echo "--- stdout ---"; cat /tmp/stdout echo "--- stderr ---"; cat /tmp/stderr

Expected behavior

A JSON object on stdout, e.g. {"targetId":"…","tabId":"…","url":"about:blank"}.

Actual behavior

  • stdout: empty

    • stderr: opened: about:blank tab: t1 id: 81AF8581814B20E48D8266B7035FCA83

    Same behavior with openclaw browser --json tabs — plain text list on stderr, nothing on stdout.

OpenClaw version

2026.4.26 (be8c246)

Operating system

Ubuntu 22.04 (kernel 5.15.0-176)

Install method

npm global

Model

openAI codex 5.5

Provider / routing chain

openAI codex

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Line 351 of dist/browser-cli-manage-DRvjKLfj.js (after npm install):

  defaultRuntime.log(`opened: ${tab.url}\n${tab.tabId ? `tab: ${tab.tabId}\n` : ""}${tab.label ? `label: ${tab.label}\n` : ""}id: ${tab.targetId}`);

  This is an unconditional plain-text emit. The file contains zero references
  to --json, isJson, outputJson, or any conditional formatting — looks
  like the JSON branch was either lost in a refactor or never implemented for
  these two handlers.

Impact and severity

Severity: High blocks automation

Additional information

2026.4.15

extent analysis

TL;DR

The --json flag is being ignored by browser open and browser tabs subcommands, causing them to emit plain text on stderr instead of JSON on stdout.

Guidance

  • The issue seems to be specific to the open and tabs handlers, as the evaluate subcommand still emits proper JSON.
  • The problem is likely due to the unconditional plain-text emit in the dist/browser-cli-manage-DRvjKLfj.js file, which lacks any conditional formatting for JSON output.
  • To verify the issue, run the provided steps to reproduce and check the output of stdout and stderr.
  • A potential workaround could be to modify the automation scripts to capture the output from stderr instead of stdout, although this would require parsing the plain text output.

Example

No code snippet is provided as it's not clearly supported by the issue, but the problematic line of code is mentioned in the issue body:

defaultRuntime.log(`opened: ${tab.url}\n${tab.tabId ? `tab: ${tab.tabId}\n` : ""}${tab.label ? `label: ${tab.label}\n` : ""}id: ${tab.targetId}`);

Notes

The issue seems to be a regression introduced in version 2026.4.26, and the previous version 2026.4.15 may not have had this issue.

Recommendation

Apply workaround: Modify automation scripts to capture output from stderr and parse the plain text output, as the --json flag is being ignored by the affected subcommands.

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

A JSON object on stdout, e.g. {"targetId":"…","tabId":"…","url":"about:blank"}.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING