Repository navigation
Conversation
Greptile SummaryThis PR introduces a complete Wear OS companion app for OpenClaw, including a direct WebSocket gateway client, a phone-proxy client over the Wear Data Layer, a transcript-first chat UI, session picker, split settings screens, Wear tile/complication entry points, and background reply notifications with quick reply. The phone-side The overall architecture is solid — the
Confidence Score: 3/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/android/wear/src/main/java/ai/openclaw/wear/gateway/PhoneProxyClient.kt
Line: 184-188
Comment:
**Untracked reconnect coroutine bypasses explicit disconnect**
When no phone node is found, the retry is launched via a plain `scope.launch` whose `Job` is never assigned to `reconnectJob`. This means `disconnect()` — which only calls `reconnectJob?.cancel()` — cannot cancel this pending retry. After an explicit disconnect, `_connected.value` is set to `false`, so when the 5-second timer fires the check `if (!_connected.value)` evaluates to `true` and `findPhoneAndPing()` is invoked again, silently reconnecting the client even after the user deliberately disconnected.
Replace the inline launch with `scheduleReconnect`, which uses `reconnectJob` and is already cancelled correctly by `disconnect()`:
```suggestion
scheduleReconnect(delayMs = 5_000)
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: apps/android/wear/src/main/java/ai/openclaw/wear/chat/WearChatController.kt
Line: 72-75
Comment:
**`pendingRunTimeoutJobs` accessed without synchronization**
`pendingRuns`, `queuedOutboundMessages`, and `dispatchJobs` are all guarded with `synchronized(…)` blocks, but `pendingRunTimeoutJobs` is a plain `mutableMapOf()` that is read and mutated concurrently across coroutines running on `Dispatchers.IO` (a shared thread pool). The same applies to `completedRunIds`. Concurrent reads/writes without synchronization can cause `ConcurrentModificationException` or lost updates on JVM.
Both maps should use the same `synchronized` pattern already used for the other maps:
```kotlin
private val pendingRunTimeoutJobs = mutableMapOf<String, Job>() // wrap all accesses in synchronized(pendingRunTimeoutJobs)
private val completedRunIds = linkedSetOf<String>() // already uses synchronized(completedRunIds), but the field itself should match the pattern
```
Alternatively, replace with `ConcurrentHashMap` (for `pendingRunTimeoutJobs`) and a `CopyOnWriteArraySet` / `Collections.synchronizedSet` (for `completedRunIds`) to avoid the synchronized boilerplate.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: apps/android/wear/src/main/java/ai/openclaw/wear/gateway/WearGatewayConfig.kt
Line: 52-63
Comment:
**Auth credentials stored in plaintext `SharedPreferences`**
`token` and `password` are persisted as plain strings in `openclaw_wear_config`. Wear OS watches are relatively locked-down devices, but ADB backup (`android:allowBackup="true"` is set in the Wear manifest), rooted devices, or a compromised companion app could expose these credentials.
Consider using `EncryptedSharedPreferences` from `androidx.security:security-crypto` for the fields that contain auth material (`gw_token`, `gw_password`), which provides AES-256 encryption backed by the Android Keystore:
```kotlin
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
private val prefs: SharedPreferences = EncryptedSharedPreferences.create(
context.applicationContext,
"openclaw_wear_config",
MasterKey.Builder(context.applicationContext)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build(),
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM,
)
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: apps/android/wear/src/main/java/ai/openclaw/wear/gateway/WearGatewayClient.kt
Line: 55-59
Comment:
**OkHttpClient thread pool not shut down on connection-mode switch**
`WearApp.switchConnectionMode` calls `directClient?.disconnect()` and then drops the reference (`directClient = null`) when creating a new `WearGatewayClient`. `disconnect()` closes the active WebSocket, but the `httpClient`'s internal dispatcher thread pool is never shut down. Each abandoned client leaves its thread pool running for up to 60 seconds (OkHttp's default idle keep-alive). If `switchConnectionMode` is called repeatedly (e.g. toggling between proxy and direct mode from settings), threads accumulate.
Add a `shutdown()` method that also cleans up the HTTP client:
```kotlin
fun shutdown() {
disconnect()
httpClient.dispatcher.executorService.shutdown()
httpClient.connectionPool.evictAll()
}
```
And call `directClient?.shutdown()` in `WearApp.switchConnectionMode` instead of `directClient?.disconnect()`.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: apps/android/wear/src/main/java/ai/openclaw/wear/WearApp.kt
Line: 77
Comment:
**`android:allowBackup="true"` exposes plaintext credentials in wear manifest**
The Wear manifest sets `android:allowBackup="true"` (the default). Combined with credentials stored in `SharedPreferences` (see the `WearGatewayConfigStore` note), this means `gw_token` and `gw_password` will be included in ADB backups. Consider either setting `android:allowBackup="false"` or, if backups are desired, using `android:fullBackupContent` rules to exclude the `openclaw_wear_config` preferences file from backups.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: d87164b |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d87164bba7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd097d2a48
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26abc34f0e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c16cea7a2f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0d52249d2
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 914b3321fb
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 744502d963
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7e125b01d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 842ea62f06
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eda1cb67b3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e611e3f416
ℹ️ 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".
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
15 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
5 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d11b0e388
ℹ️ 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".
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.ReplyandLatest.Security Impact (required)
Yes)Yes)Yes)No)Yes)Yes, explain risk + mitigation: The Wear app addsPOST_NOTIFICATIONS, Wear Data Layer messaging, direct gateway WebSocket access, and storage of watch-side gateway config including token-based direct auth. Risk is constrained by using the existing authenticated gateway paths, limiting watch data access to the same session/gateway calls already exposed by the phone client, honoring platform notification permission, and keeping watch auth/config local to the Wear app. Phone-proxy traffic stays within the paired phone/watch channel and only proxies requests through the phone's active operator session.Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Actual screenshots from Pixel Watch 2:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
apps/android/wear/**,apps/android/app/src/main/java/ai/openclaw/app/wear/WearProxyService.kt,apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt,apps/android/app/src/main/AndroidManifest.xml, andapps/android/app/build.gradle.kts.Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.