openclaw - 💡(How to fix) Fix [Bug]: mine client request session.list error: scope operator.read do not have

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…
if (
            !device &&
            (decision.kind !== "allow" ||
              (!preserveInsecureLocalControlUiScopes &&
                (authMethod === "token" || authMethod === "password" || trustedProxyAuthOk)))
          ) {

this code in message-handler.js will clear scope when I use electron connect mine openclaw

Error Message

error when call seesion.list

Root Cause

if (
            !device &&
            (decision.kind !== "allow" ||
              (!preserveInsecureLocalControlUiScopes &&
                (authMethod === "token" || authMethod === "password" || trustedProxyAuthOk)))
          ) {

this code in message-handler.js will clear scope when I use electron connect mine openclaw

Code Example

if (
            !device &&
            (decision.kind !== "allow" ||
              (!preserveInsecureLocalControlUiScopes &&
                (authMethod === "token" || authMethod === "password" || trustedProxyAuthOk)))
          ) {

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

if (
            !device &&
            (decision.kind !== "allow" ||
              (!preserveInsecureLocalControlUiScopes &&
                (authMethod === "token" || authMethod === "password" || trustedProxyAuthOk)))
          ) {

this code in message-handler.js will clear scope when I use electron connect mine openclaw

Steps to reproduce

error when call seesion.list

Expected behavior

Do not clear the scope when I request it locally

Actual behavior

1

OpenClaw version

today commit

Operating system

mac

Install method

No response

Model

all

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To prevent the scope from being cleared when requesting locally, we need to modify the condition in message-handler.js.

  • Update the condition to check for the electron environment and exclude it from scope clearing:
if (
  !device &&
  (decision.kind !== "allow" ||
    (!preserveInsecureLocalControlUiScopes &&
      (authMethod === "token" || authMethod === "password" || trustedProxyAuthOk) &&
      !isElectronEnvironment))
) {
  // ...
}

// Add a function to check for Electron environment
function isElectronEnvironment() {
  return typeof window !== 'undefined' && window.process && window.process.type === 'renderer';
}
  • Alternatively, you can also add a check for the openclaw provider and exclude it from scope clearing:
if (
  !device &&
  (decision.kind !== "allow" ||
    (!preserveInsecureLocalControlUiScopes &&
      (authMethod === "token" || authMethod === "password" || trustedProxyAuthOk) &&
      provider !== 'openclaw'))
) {
  // ...
}

Verification

To verify the fix, call session.list and check that the scope is not cleared when using Electron to connect to OpenClaw.

Extra Tips

Make sure to test the updated condition with different authentication methods and providers to ensure it works as expected. Additionally, consider adding more logging or debugging statements to help diagnose any future issues.

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

Do not clear the scope when I request it locally

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]: mine client request session.list error: scope operator.read do not have