feat(android): Multiple nodes session context isolated from each other#53752
feat(android): Multiple nodes session context isolated from each other#53752obviyus merged 5 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR scopes each Android device to its own session by deriving a unique key ( Changes made:
Issues found:
Confidence Score: 3/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09155e198f
ℹ️ 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: 5c4ea8983a
ℹ️ 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".
|
How about letting users create new sessions or defining the ID themselves? I'm specifically thinking about how to deal with this in the Wear OS PR. People will want to share the same session with the app or use their own session, or have a mixture of both. I think the solution should be more advanced, but this is a great start to separate this! I personally still think the android app is a mixture of a node and a channel/provider. Sensors etc are definitely a node capability, but the chat works more like a channel/provider like Telegram or WhatsApp are, and could offer similar ways to create chats/groups/threads. |
@sibbl I fully agree with your judgment that
In addition, the current Android application will display all conversation lists for users to choose from. Can this design meet the requirements you mentioned But I'm not sure how to interact with users on the WearOS screen and display a list of all sessions? |
|
@lixuankai yep, the foundation is what we need. Just sharing my thoughts here, as my Wear OS PR has been open for a while and I watch new PRs since I need to also migrate them over until my PR is reviewed.
As of now, the selected session can be changed with a swipe and 2 taps. However, this depends heavily on where we want to get to with the Android app and its session management. Will it just have one session per node? Per device? Will users be able to quickly create new sessions? Can users even switch between agents? Lots of questions from a user's perspective, which are already solved on channel/provider level where I can configure which agents match which e.g. telegram group etc. |
|
@obviyus please check , thank you |
|
I think Android should default to a private per-device chat session, with shared sessions exposed explicitly as selectable threads instead of implicitly inheriting the gateway main session. That keeps the UX predictable, avoids cross-device context bleed by default, and gives Wear OS / multi-device follow-up work a clean base: one deterministic device-owned default session, optional shared sessions by user choice. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4dd3900c1
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val sessionCfg = config?.get("session").asObjectOrNull() | ||
| val mainKey = normalizeMainKey(sessionCfg?.get("mainKey").asStringOrNull()) | ||
| applyMainSessionKey(mainKey) | ||
| syncMainSessionKey(gatewayDefaultAgentId) |
There was a problem hiding this comment.
Avoid deriving main session from stale cached default agent
refreshBrandingFromGateway now forces syncMainSessionKey(gatewayDefaultAgentId), but gatewayDefaultAgentId is only refreshed later in refreshAgentsFromGateway and is never cleared on disconnect. In a delayed/failed agents.list refresh (including after switching gateways), this can reapply an old agent id and overwrite _mainSessionKey, so chat/mic requests are sent under the wrong session key until a future successful agents refresh.
Useful? React with 👍 / 👎.
|
Landed on main. Thanks @lixuankai. |
* [feat]Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * fix(android): isolate device chat defaults --------- Co-authored-by: lixuankai <lixuankai@oppo.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* [feat]Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * fix(android): isolate device chat defaults --------- Co-authored-by: lixuankai <lixuankai@oppo.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* [feat]Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * fix(android): isolate device chat defaults --------- Co-authored-by: lixuankai <lixuankai@oppo.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* [feat]Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * fix(android): isolate device chat defaults --------- Co-authored-by: lixuankai <lixuankai@oppo.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* [feat]Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * feat(android): Multiple nodes session context isolated from each other * fix(android): isolate device chat defaults --------- Co-authored-by: lixuankai <lixuankai@oppo.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Summary
My family have
two Android Deviceconnected to thesame gateway.Due to the same session
agent:main:main, we can see everyone 's chat history.Like this,
Find X7 Ultrachat history onOnePlus 13TOnePlus 13Tchat history onFind X7 UltraThis is a bad experience. When communicating with OpenClaw, the context interferes with each other
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Users can see
independent sessions of multiple nodes at the top of chatSheetContent, and the context does not interfere with each other when communicating with OpenClawSecurity Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
Expected
Two devices chatting with OpenClaw
without interfering with each otherActual
Matches expected.
Evidence
Attach at least one:
And We can see every node session on WebUI.
Like this
[agent:main:node-c682443feaa8][agent:main:node-6bc70a46c7ea]Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
No)No)No)Failure Recovery (if this breaks)
Risks and Mitigations
none