Skip to content

fix(android): accept boolean flag aliases in node invoke params - #99873

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
ly85206559:fix/android-parse-json-boolean-flag
Jul 6, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
ly85206559:fix/android-parse-json-boolean-flag

Conversation

@ly85206559

@ly85206559 ly85206559 commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android node invoke handlers use parseJsonBooleanFlag for flags such as includeSystem, includeDisabled, includeNonLaunchable, includeAudio, and presence beacon ok/handled. That helper only accepted "true" / "false" string literals, while nearby Android voice parsers already accept common dictated/config-style aliases like yes/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: CameraCaptureManager read includeAudio through the shared helper, but CameraHandler.handleClip kept a duplicate strict parser. An alias such as includeAudio: "no" could record without audio while the wrapper still marked external audio capture as active.

Why This Change Was Made

Extend parseJsonBooleanFlag to match the existing Android alias set used by the voice parsing paths, and route CameraHandler includeAudio through the same helper so both camera paths agree on alias semantics.

Unknown strings such as "maybe" still return null and fall through to existing caller defaults.

User Impact

Node invoke commands that pass boolean flags as yes, no, 1, or 0 now behave as operators expect—for example device app listing filters and camera includeAudio. Strict JSON boolean literals continue to work.

Evidence

Sibling parser contract checked:

  • apps/android/app/src/main/java/ai/openclaw/app/voice/TalkDirectiveParser.kt (asBooleanOrNull accepts true/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.parseIncludeAudio now delegates to parseJsonBooleanFlag(parseJsonParamsObject(...), "includeAudio"), matching CameraCaptureManager.

Local Gradle unit proof on Windows / Android Studio JBR:

cd apps/android
$env:JAVA_HOME = "F:\Program Files\Android\Android Studio\jbr"
$env:ANDROID_HOME = "F:\Android\Sdk"
$env:ANDROID_SDK_ROOT = "F:\Android\Sdk"
.\gradlew.bat :app:testPlayDebugUnitTest --tests "ai.openclaw.app.node.NodeUtilsTest"
.\gradlew.bat :app:testThirdPartyDebugUnitTest --tests "ai.openclaw.app.node.NodeUtilsTest"

Result: BUILD SUCCESSFUL (4 tests).

CI: android-test-play, android-test-third-party, and preflight are green on the latest push.

Changed files:

  • apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt
  • apps/android/app/src/main/java/ai/openclaw/app/node/CameraHandler.kt
  • apps/android/app/src/test/java/ai/openclaw/app/node/NodeUtilsTest.kt

On-device instrumented proof (Android emulator, real PackageManager path):

Ran DeviceHandler.handleDeviceApps on a booted Android emulator via am instrument, exercising the real parseJsonBooleanFlag -> device PackageManager path (no Robolectric). The device.apps response echoes the parsed includeSystem boolean, so the alias resolution is visible in the response itself:

$ adb shell am instrument -w -e class ai.openclaw.app.node.DeviceAppsBooleanAliasProofTest ai.openclaw.app.test/androidx.test.runner.AndroidJUnitRunner
ai.openclaw.app.node.DeviceAppsBooleanAliasProofTest:..
Time: 0.27
OK (2 tests)
I openclaw.proof: alias=yes params={"includeSystem":"yes","limit":200} payload={"count":20,...,"includeSystem":true,...}
I openclaw.proof: alias=no  params={"includeSystem":"no","limit":200}  payload={"count":1,...,"includeSystem":false,...}
I openclaw.proof: alias=1   params={"includeSystem":"1","limit":200}   payload={"count":20,...,"includeSystem":true,...}
I openclaw.proof: alias=0   params={"includeSystem":"0","limit":200}   payload={"count":1,...,"includeSystem":false,...}
I openclaw.proof: RESULT yes(flag=true,count=20) no(flag=false,count=1)
I openclaw.proof: RESULT 1(flag=true) 0(flag=false)

Interpretation: includeSystem: "yes" / "1" resolve to true and return all 20 installed apps (19 system + OpenClaw Node); "no" / "0" resolve to false and return only the 1 non-system app. On main/v2026.6.11 these aliases are unknown to parseJsonBooleanFlag, so "yes" would fall back to the default false — the true result here proves the alias now flows through the real app path after the fix.

@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 9:57 AM ET / 13:57 UTC.

Summary
The branch extends Android node JSON boolean parsing to accept yes/no/1/0 aliases, routes camera includeAudio through the shared parser, and adds NodeUtils tests.

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: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair job is needed; the PR is review-clean and now has real Android proof, so the remaining action is ordinary maintainer merge review.

Security
Cleared: The diff only changes Android boolean parsing and tests; it does not alter dependencies, workflows, secrets, permissions, package metadata, or code execution surfaces.

Review details

Best 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 changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes copied live Android emulator instrumented output showing yes/no/1/0 aliases flowing through DeviceHandler.handleDeviceApps and the real PackageManager path after the fix.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body now includes copied live Android emulator instrumented output showing yes/no/1/0 aliases flowing through DeviceHandler.handleDeviceApps and the real PackageManager path after the fix.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a focused Android node invoke bugfix with limited blast radius, green Android CI, and no remaining blocking review finding.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body now includes copied live Android emulator instrumented output showing yes/no/1/0 aliases flowing through DeviceHandler.handleDeviceApps and the real PackageManager path after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes copied live Android emulator instrumented output showing yes/no/1/0 aliases flowing through DeviceHandler.handleDeviceApps and the real PackageManager path after the fix.
Evidence reviewed

PR surface:

Other +45. Total +45 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 69 24 +45
Total 3 69 24 +45

What I checked:

Likely related people:

  • steipete: Current checkout blame points the shared helper and old CameraHandler parser lines at the current main boundary, and GitHub path history shows recent Android node/helper comment work by this account. (role: recent area contributor; confidence: medium; commits: 49302fcb7df5, 85beee613c64; files: apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt, apps/android/app/src/main/java/ai/openclaw/app/node/CameraHandler.kt)
  • Tosko4: GitHub path history identifies this account as author of the installed-apps node command that consumes includeSystem, includeDisabled, and includeNonLaunchable through the shared parser. (role: introduced behavior; confidence: high; commits: 3d1ec371295c; files: apps/android/app/src/main/java/ai/openclaw/app/node/DeviceHandler.kt)
  • NianJiuZst: Recent Android camera changes touched the camera capture/cleanup paths around CameraCaptureManager and CameraHandler, which are affected by includeAudio parsing. (role: recent area contributor; confidence: medium; commits: 00599dd1edd7, 98e97661dae4; files: apps/android/app/src/main/java/ai/openclaw/app/node/CameraCaptureManager.kt, apps/android/app/src/main/java/ai/openclaw/app/node/CameraHandler.kt)
  • obviyus: GitHub path history shows adjacent Android node/package work including system-app classification and package rename changes near the affected device apps surface. (role: adjacent owner; confidence: medium; commits: e31f351923ec, 5568b393a86d; files: apps/android/app/src/main/java/ai/openclaw/app/node/DeviceHandler.kt, apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-07-05T09:21:17.975Z sha 3911a5e53835caec0a838a421b49445883e7ddef :: needs real behavior proof before merge. :: [P2] Use the alias parser for CameraHandler includeAudio too
  • reviewed 2026-07-05T09:34:14.200Z sha 3911a5e53835caec0a838a421b49445883e7ddef :: needs real behavior proof before merge. :: [P2] Route CameraHandler includeAudio through the alias parser
  • reviewed 2026-07-05T12:28:53.714Z sha 7d0ea255ea29bd6b450db65b9a96ae247892c487 :: needs real behavior proof before merge. :: none

@ly85206559
ly85206559 force-pushed the fix/android-parse-json-boolean-flag branch from 3c35ccc to 3911a5e Compare July 5, 2026 09:08
@ly85206559

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 5, 2026
@ly85206559

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Follow-up for the CameraHandler split-brain finding:

  • \CameraHandler.parseIncludeAudio\ now delegates to \parseJsonBooleanFlag, matching \CameraCaptureManager.
  • Added \parseJsonBooleanFlag_parsesIncludeAudioAliasesForCameraClip\ coverage for
    o/\

@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@ly85206559

Copy link
Copy Markdown
Contributor Author

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

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jul 5, 2026
@ly85206559

Copy link
Copy Markdown
Contributor Author

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).

  • includeSystem "yes" / "1" -> response includeSystem=true, count=20 (19 system apps + OpenClaw Node)
  • includeSystem "no" / "0" -> response includeSystem=false, count=1 (only the non-system app)

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

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 5, 2026
@vincentkoc vincentkoc self-assigned this Jul 6, 2026
ly85206559 and others added 2 commits July 6, 2026 01:29
Extend parseJsonBooleanFlag to recognize yes/no/1/0 like TalkDirectiveParser so node handlers honor common string boolean inputs.

Co-authored-by: Cursor <[email protected]>
@vincentkoc
vincentkoc force-pushed the fix/android-parse-json-boolean-flag branch from 7d0ea25 to 1258c88 Compare July 6, 2026 08:29
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete for exact head 1258c8804a3a3906f6444882c2f202b8c79d079b.

Proceeding with the native exact-head squash-merge guard.

@vincentkoc
vincentkoc merged commit 489af13 into openclaw:main Jul 6, 2026
41 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants