Skip to content

fix(gateway): allow cron commands to use gateway.remote.token#27286

Merged
steipete merged 2 commits intoopenclaw:mainfrom
zhangzhefang-github:fix/27246-token-mismatch
Feb 26, 2026
Merged

fix(gateway): allow cron commands to use gateway.remote.token#27286
steipete merged 2 commits intoopenclaw:mainfrom
zhangzhefang-github:fix/27246-token-mismatch

Conversation

@zhangzhefang-github
Copy link
Contributor

Closes #27246

@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime size: XS labels Feb 26, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 26, 2026

Greptile Summary

Attempted to allow cron commands running in local mode to use gateway.remote.token as a fallback credential when gateway.auth.token is not set.

Critical Issue Found:

  • The change doesn't work as intended due to line 119, which sets remote = undefined when in local mode
  • This causes remoteToken and remotePassword to always be undefined in local mode, making the fallback logic ineffective
  • Line 119 should unconditionally read params.cfg.gateway?.remote instead of conditionally based on mode

Additional Observations:

Confidence Score: 0/5

  • This PR contains a critical logic error that prevents the intended functionality from working
  • The change attempts to add a fallback to use remote credentials in local mode, but due to line 119 conditionally setting remote to undefined when in local mode, the new fallback logic will never execute. This makes the entire change non-functional and needs to be fixed before merging.
  • src/gateway/credentials.ts requires fixing the logic bug on line 119, and the PR needs test coverage for the new behavior

Last reviewed commit: 70f05c8

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 26, 2026

Additional Comments (1)

src/gateway/credentials.ts
remote is set to undefined when mode === "local", which means remoteToken and remotePassword (lines 123-124) will always be undefined in local mode. The fallback logic on lines 134-135 won't work as intended.

  const remote = params.cfg.gateway?.remote;
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/gateway/credentials.ts
Line: 119

Comment:
`remote` is set to `undefined` when `mode === "local"`, which means `remoteToken` and `remotePassword` (lines 123-124) will always be `undefined` in local mode. The fallback logic on lines 134-135 won't work as intended.

```suggestion
  const remote = params.cfg.gateway?.remote;
```

How can I resolve this? If you propose a fix, please make it concise.

@zhangzhefang-github
Copy link
Contributor Author

CI check failed. Can someone help check the logs? The error is about which doesn't exist in the current codebase.

@steipete steipete merged commit 77a3930 into openclaw:main Feb 26, 2026
20 of 22 checks passed
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Feb 27, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
steipete added a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
thebenjaminlee pushed a commit to escape-velocity-ventures/openclaw that referenced this pull request Mar 7, 2026
…aw#27286)

* fix(gateway): allow cron commands to use gateway.remote.token

* fix(gateway): make local remote-token fallback effective

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway token mismatch unauthorized error even when auth/remote tokens match

2 participants