Skip to content

refactor(android): reuse node JSON param parser - #120456

Merged
vincentkoc merged 1 commit into
mainfrom
fix/mcp-lint-gate-tests
Aug 26, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/mcp-lint-gate-tests

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The Android notification and system handlers each carried a private copy of the node layer's JSON-object parameter parser. The canonical parser already lives in NodeUtils.kt and has the same absent, malformed, and non-object behavior.

The previous test-only MCP lint-gate work on this draft remains preserved at signed head 629618e42d3664783bdbd0013c7f2223a427b45f. Its body explicitly marked it "Draft only. Do not merge as part of this execution." This rewrite reuses that deferred draft slot instead of opening another maintainer PR above the repository cap.

Why This Change Was Made

  • Route notification action parameters through parseJsonParamsObject.
  • Route system notification parameters through the same canonical parser.
  • Delete both identical private parsers and their now-unused serialization imports.
  • Leave handler-specific validation and protocol error messages at their existing owners.

No SDK seam, protocol, config, persistence, authorization, compatibility, or dependency change.

User Impact

No intended behavior change. Null, blank, malformed, and non-object JSON still fail through the same handler-specific invalid-request paths; valid objects retain their existing field validation.

Evidence

Exact head: 7bc4984fe3d61c05303485c10235b5cebe36fd86

Test Audit

No new test was added. The canonical parser already has direct malformed/object-shape coverage, and both handlers retain focused invalid-request and valid-request tests. The change removes duplicate implementation without introducing a new observable contract or test-only seam.

AI-assisted: yes.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Aug 8, 2026
@vincentkoc vincentkoc self-assigned this Aug 8, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

Exact head: 629618e42d3664783bdbd0013c7f2223a427b45f

@clawsweeper

clawsweeper Bot commented Aug 8, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 8:21 PM ET / August 26, 2026, 00:21 UTC.

ClawSweeper review

What this changes

The PR replaces two Android handler-local JSON-object parsers with the shared node parser while preserving each handler’s validation behavior.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal maintainer review: current main still has both duplicated parsers, while this branch routes both callers to a source-identical shared implementation without changing handler validation.

Priority: P3
Reviewed head: 7bc4984fe3d61c05303485c10235b5cebe36fd86

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The small source-equivalent cleanup has focused validation evidence and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored behavior-neutral refactor is outside the external-contributor proof gate; the PR supplies exact-head Android build, test, and lint evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored behavior-neutral refactor is outside the external-contributor proof gate; the PR supplies exact-head Android build, test, and lint evidence.
Evidence reviewed 7 items Shared parser contract: The shared parser returns null for blank, malformed, and non-object JSON by using the same blank check, parse call, object cast, and Throwable catch as the deleted handler-local functions.
Notification handler equivalence: The branch replaces only the local parser call and removes the identical local implementation; existing action validation and error responses remain at their owner.
System handler equivalence: The branch preserves title/body validation and notification authorization/posting behavior, changing only the JSON-object parser owner.
Findings None None.
Security None None.

Live Verification

Command: cd apps/android && ./gradlew :app:testPlayDebugUnitTest --tests 'ai.openclaw.app.node.NodeUtilsTest' --tests 'ai.openclaw.app.node.NotificationsHandlerTest' --tests 'ai.openclaw.app.node.SystemHandlerTest'

Result: FAIL (failed) — step 1 run cd apps/android && ./gradlew :app:testPlayDebugUnitTest --tests 'ai.openclaw.app.node.NodeUtilsTest' --tests 'ai.openclaw.app.node.NotificationsHandlerTest' --tests 'ai.openclaw.app.node.SystemHandlerTest': previous terminal command was still running after 30 seconds: "cd apps/android && ./gradlew :app:testPlayDebugUnitTest --tests 'ai.openclaw.app.node.NodeUtilsTest' --tests 'ai.openclaw.app.node.NotificationsHandlerTest' --tests 'ai.openclaw.app.node.SystemHandlerTest'"

Fetching distribution.
Downloading https://services.gradle.org/distributions/gradle-9.7.0-bin.zip
..............10%..............20%..............30%...............40%..............50%...............60%..............70%..............80%...............90%....
..........100%

Welcome to Gradle 9.7.0!

Here are the highlights of this release:
 - Isolated Projects graduates to incubating
 - Broader Configuration Cache compatibility
 - More source locations in problem reports

For more details see https://docs.gradle.org/9.7.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
│···············│ 0% CONFIGURING [21s]
› IDLE
› IDLE
› root project › Resolve dependencies of classpath › j2objc-annotations-2.8.pom
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› root project › Resolve dependencies of classpath › jsr305-3.0.2.pom
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE
› IDLE

Assertions:

  • FAIL expect_output: BUILD SUCCESSFUL

How this fits together

Android gateway invocation handlers receive JSON parameters from the Gateway session, parse object-shaped requests, then perform notification or system actions. This PR centralizes parsing in the shared node utility before handler-specific validation.

flowchart LR
  A[Gateway invocation] --> B[Android node handler]
  B --> C[Shared JSON object parser]
  C --> D{Valid object?}
  D -->|No| E[Handler invalid-request response]
  D -->|Yes| F[Notification or system action]
Loading

Before merge

  • Complete next step (P2) - This protected, MEMBER-authored PR needs ordinary maintainer review, not an automated repair lane.
Agent review details

Security

None.

PR surface

Other -21. Total -21 across 2 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 2 2 23 -21
Total 2 2 23 -21

Review metrics

Metric Value Why it matters
Production consolidation production -21, tests 0 The two duplicated parser bodies are removed without adding configuration, API, or behavior surface.

Technical review

Best possible solution:

Land the two handler call-site substitutions as one canonical parser path after normal maintainer review of the current head.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a behavior-preserving refactor, and the deleted and shared parser bodies are source-equivalent.

Is this the best way to solve the issue?

Yes: centralizing the identical parser in its existing node utility removes duplication while leaving handler-specific request validation in place.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 18ad0dda9137.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a behavior-neutral Android cleanup with no reported user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored behavior-neutral refactor is outside the external-contributor proof gate; the PR supplies exact-head Android build, test, and lint evidence.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Authored the current refactor and an earlier Android cleanup found in local history. (role: recent Android node contributor; confidence: medium; commits: 7bc4984fe3d6, 1423487351d6; files: apps/android/app/src/main/java/ai/openclaw/app/node/NotificationsHandler.kt, apps/android/app/src/main/java/ai/openclaw/app/node/SystemHandler.kt)
  • Peter Steinberger: A recent current-main commit touching the Android node utility is attributable to this area. (role: recent shared-utility contributor; confidence: medium; commits: f90a9c720e24; files: apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt)
  • Ben.Li: Local history associates this contributor with prior node-parameter parsing work in the shared utility. (role: adjacent shared-parser contributor; confidence: medium; commits: 489af13dbd9e; files: apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-08T05:53:00.222Z sha 629618e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-08T06:46:44.983Z sha 629618e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T12:31:23.049Z sha 629618e :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 8, 2026
@vincentkoc
vincentkoc force-pushed the fix/mcp-lint-gate-tests branch from 629618e to 7bc4984 Compare August 25, 2026 23:20
@vincentkoc vincentkoc changed the title test(cli): repair MCP lint gate refactor(android): reuse node JSON param parser Aug 25, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 25, 2026 23:20
@openclaw-barnacle openclaw-barnacle Bot added app: android App: android and removed cli CLI command changes labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 26, 2026
@vincentkoc
vincentkoc merged commit 0036788 into main Aug 26, 2026
111 of 118 checks passed
@vincentkoc
vincentkoc deleted the fix/mcp-lint-gate-tests branch August 26, 2026 00:48
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

threely-lab pushed a commit to threely-lab/openclaw that referenced this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

1 participant