fix(gateway): preserve device token for fallback auth during SPA navigation#39639
fix(gateway): preserve device token for fallback auth during SPA navigation#39639openperf wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a real SPA-navigation regression by simplifying However, the two updated test cases in
The fix is to add a Confidence Score: 2/5
Last reviewed commit: c33bac5 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c33bac57dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 397a03a5f7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thanks for the work here. I reviewed this against what landed in #40892, now merged to That merged fix resolves the same Control UI auth-loss regression by restoring current-tab token continuity through Closing as superseded by #40892. If there is still a separate device-token fallback bug on current |
Update connect-auth tests to assert that the stored device token is included in the auth payload even when an explicit shared token or password is provided. Previously the tests asserted deviceToken was undefined in these cases, matching the old suppression behavior. Add `deviceIdentity` to the Node.js client test fixtures so the stored-token lookup path is exercised (addresses the missing `deviceIdentity` config gap flagged during review of openclaw#39639).
Summary
src/gateway/client.ts(Node.js) andui/src/ui/gateway.ts(browser), theresolvedDeviceTokenlogic incorrectly suppresses the stored device token when an explicit shared token or password is provided. Furthermore, the browser client's auth payload was missing thedeviceTokenfield entirely. This causes the Control UI to fail with a "device identity required" error upon WebSocket reconnects, because the gateway server cannot fall back to the device token when the shared token is absent or invalid.resolvedDeviceTokenin both the Node.js client and the browser client to always resolve the device token independently of shared credentials (explicitDeviceToken ?? storedToken ?? undefined).deviceTokenfield alongside the shared token, enabling gateway-side fallback.deviceIdentityto two test cases inclient.test.tsfor clarity, and updatedgateway.node.test.tsto verify the new fallback behavior.authTokenstill prefers the explicit shared token over the device token. The close handler logic for clearing stale device tokens remains unaffected.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
AI-Assisted Contribution