Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kkarimi
Copy link
Contributor

@kkarimi kkarimi commented Jan 16, 2026

Summary

  • Fixes token/password resolution to check config file's gateway.mode directly
  • Prevents wrong token path being used when UserDefaults is out of sync with config file

Closes #1021

Changes

The GatewayEndpointStore.Deps.live token and password closures now check the config file's gateway.mode value directly, in addition to CommandResolver.connectionModeIsRemote() (which reads from UserDefaults).

This ensures that when the config file has gateway.mode = "remote", the app will correctly read from gateway.remote.token even if UserDefaults hasn't been synchronized.

let configMode = (root["gateway"] as? [String: Any])?["mode"] as? String
let isRemote = configMode?.lowercased() == "remote" || CommandResolver.connectionModeIsRemote()

Test plan

  • Build succeeds (swift build --package-path apps/macos)
  • Configure remote mode in config file with remote token
  • Verify "Test remote" connects successfully
  • Verify local mode still works when configured

🤖 Generated with Claude Code

@kkarimi kkarimi force-pushed the fix/gateway-token-resolution-mode-check branch from a3b38a9 to 474c61c Compare January 16, 2026 15:58
@steipete steipete force-pushed the fix/gateway-token-resolution-mode-check branch from bdec4fd to 15b64eb Compare January 16, 2026 19:27
@steipete
Copy link
Contributor

Updated branch to landable state (rebased onto current main, dropped unrelated oxfmt-only noise).

  • Added shared ConnectionModeResolver so config gateway.mode (and gateway.remote.url heuristic) drives mode consistently.
  • macOS: token/password resolution now uses resolver; warns (once) when CLAWDBOT_GATEWAY_TOKEN/PASSWORD env overrides config.
  • CLI doctor: warns on macOS launchctl getenv overrides; docs + changelog updated.

Local gate:

  • pnpm lint && pnpm format && pnpm build && pnpm test
  • swift build --package-path apps/macos && swift test --package-path apps/macos

Commits: 15b64eb, c46dfc8

@steipete steipete merged commit 25ae5f8 into openclaw:main Jan 16, 2026
41 of 42 checks passed
@steipete
Copy link
Contributor

Merged via squash.

Merge commit: 25ae5f8

Thanks @kkarimi!

TSavo pushed a commit to TSavo/clawdbot that referenced this pull request Jan 18, 2026
…ion (openclaw#1022)

* fix: honor config gateway mode for credentials

* chore: oxfmt doctor platform notes

---------

Co-authored-by: Peter Steinberger <[email protected]>
rsneh pushed a commit to rsneh/clawdbot that referenced this pull request Jan 21, 2026
…ion (openclaw#1022)

* fix: honor config gateway mode for credentials

* chore: oxfmt doctor platform notes

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: Stale launchctl CLAWDBOT_GATEWAY_TOKEN causes persistent unauthorized errors

2 participants