Repository navigation
fix(android): accept boolean flag aliases in node invoke params - #99873
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 9:57 AM ET / 13:57 UTC. Summary PR surface: Other +45. Total +45 across 3 files. Reproducibility: yes. Current main and v2026.6.11 only accept strict true/false in parseJsonBooleanFlag, so yes/no/1/0 aliases resolve null and fall through to caller defaults; the PR body adds live emulator proof for the fixed device.apps path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the shared parser update with its helper tests and live Android node.invoke proof after normal exact-head CI and maintainer checks. Do we have a high-confidence way to reproduce the issue? Yes. Current main and v2026.6.11 only accept strict true/false in parseJsonBooleanFlag, so yes/no/1/0 aliases resolve null and fall through to caller defaults; the PR body adds live emulator proof for the fixed device.apps path. Is this the best way to solve the issue? Yes. Updating the shared Android node helper and deleting CameraHandler's duplicate strict parser is narrower and more maintainable than adding per-caller alias handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 16865d58ca1f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other +45. Total +45 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles)
|
3c35ccc to
3911a5e
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Follow-up for the CameraHandler split-brain finding:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Bot re-review was acked at 11:58 UTC but the review comment has not updated (still the 09:35 version against the prior commit). Re-triggering for commit 7d0ea255ea. @clawsweeper re-review |
|
Added on-device instrumented proof to the PR body. Ran DeviceHandler.handleDeviceApps on a booted Android emulator through the real parseJsonBooleanFlag -> PackageManager path (am instrument, no Robolectric).
The echoed includeSystem=true for the "yes" alias proves the boolean aliases now flow through the real app path (on main/v2026.6.11 "yes" is unknown and falls back to false). @clawsweeper re-review |
Extend parseJsonBooleanFlag to recognize yes/no/1/0 like TalkDirectiveParser so node handlers honor common string boolean inputs. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
7d0ea25 to
1258c88
Compare
|
Maintainer verification complete for exact head
Proceeding with the native exact-head squash-merge guard. |
|
Merged via squash.
|
…claw#99873) * fix(android): accept boolean flag aliases in node invoke params Extend parseJsonBooleanFlag to recognize yes/no/1/0 like TalkDirectiveParser so node handlers honor common string boolean inputs. Co-authored-by: Cursor <[email protected]> * fix(android): route CameraHandler includeAudio through alias parser Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
What Problem This Solves
Android node invoke handlers use
parseJsonBooleanFlagfor flags such asincludeSystem,includeDisabled,includeNonLaunchable,includeAudio, and presence beaconok/handled. That helper only accepted"true"/"false"string literals, while nearby Android voice parsers already accept common dictated/config-style aliases likeyes/no/1/0.Agent/tool params using those aliases were silently treated as unset and fell back to defaults.
For
camera.clip, the mismatch was worse:CameraCaptureManagerreadincludeAudiothrough the shared helper, butCameraHandler.handleClipkept a duplicate strict parser. An alias such asincludeAudio: "no"could record without audio while the wrapper still marked external audio capture as active.Why This Change Was Made
Extend
parseJsonBooleanFlagto match the existing Android alias set used by the voice parsing paths, and routeCameraHandlerincludeAudiothrough the same helper so both camera paths agree on alias semantics.Unknown strings such as
"maybe"still returnnulland fall through to existing caller defaults.User Impact
Node invoke commands that pass boolean flags as
yes,no,1, or0now behave as operators expect—for example device app listing filters and cameraincludeAudio. Strict JSON boolean literals continue to work.Evidence
Sibling parser contract checked:
apps/android/app/src/main/java/ai/openclaw/app/voice/TalkDirectiveParser.kt(asBooleanOrNullacceptstrue/false/yes/no/1/0)apps/android/app/src/main/java/ai/openclaw/app/voice/TalkModeManager.kt(same alias set)ClawSweeper follow-up addressed:
CameraHandler.parseIncludeAudionow delegates toparseJsonBooleanFlag(parseJsonParamsObject(...), "includeAudio"), matchingCameraCaptureManager.Local Gradle unit proof on Windows / Android Studio JBR:
Result: BUILD SUCCESSFUL (4 tests).
CI:
android-test-play,android-test-third-party, andpreflightare green on the latest push.Changed files:
apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.ktapps/android/app/src/main/java/ai/openclaw/app/node/CameraHandler.ktapps/android/app/src/test/java/ai/openclaw/app/node/NodeUtilsTest.ktOn-device instrumented proof (Android emulator, real PackageManager path):
Ran
DeviceHandler.handleDeviceAppson a booted Android emulator viaam instrument, exercising the realparseJsonBooleanFlag-> devicePackageManagerpath (no Robolectric). Thedevice.appsresponse echoes the parsedincludeSystemboolean, so the alias resolution is visible in the response itself:Interpretation:
includeSystem: "yes"/"1"resolve totrueand return all 20 installed apps (19 system + OpenClaw Node);"no"/"0"resolve tofalseand return only the 1 non-system app. Onmain/v2026.6.11 these aliases are unknown toparseJsonBooleanFlag, so"yes"would fall back to the defaultfalse— thetrueresult here proves the alias now flows through the real app path after the fix.