Skip to content

refactor(android): decouple shared JSON values from node handlers - #202840

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/android-runtime-contracts-20261121
Nov 26, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/android-runtime-contracts-20261121

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Related: #202818

What Problem This Solves

Android chat, Gateway, voice, Wear and display-model code import generic JSON value helpers from the node-handler utilities. Those utilities also own invocation results and feature-specific parsing, coupling otherwise shared data handling to node code.

User Impact

No user-visible change. Object/array casts and primitive text/null handling keep their existing semantics and visibility. No configuration or data migration is needed.

Why This Change Was Made

Move the three unchanged extensions into the existing shared GatewayJson owner and migrate every caller, including the node handlers. Remove the old declarations and their imports without adding compatibility wrappers. Production code is 13 lines smaller.

The broader Gateway-sharing work in #142954 remains separate; this change does not take on its authentication or dependency changes.

Evidence

  • Reviewed replacement head: 0758126e9451f3a6fad9c46bc6ffeb24096043db, based on f7c8162d8304b6d0f8deaae581fababc2ab933eb. Rebase resolves only the GatewaySession import conflict and preserves main's profileActivityViewerId decoding.
  • Both Play and third-party Kotlin compilation and Kotlin lint passed. Nine existing suites passed in each flavor: 166 tests per flavor, zero failures, errors or skips. Coverage includes the original JSON consumers plus Gateway invocation, retained pins and session wake recovery.
  • Local proof exercised the replacement's exact Android subtree with unchanged Android build/dependency inputs in the retained frozen tooling environment. All 2,269 Android string-inventory entries match the candidate. The staged-content/freshness guard and diff whitespace checks passed. This is Android-source proof, not whole-repository current-head CI.
  • Fresh independent source review and local ClawSweeper review of the complete f7c8162d8304b6d0f8deaae581fababc2ab933eb..0758126e9451f3a6fad9c46bc6ffeb24096043db range found no actionable correctness or security issues. Review coverage is source-only.
  • Helper declarations/bodies are unchanged, all callers migrated, and no old qualified imports remain. No new tests or test-only production seams.

Current-head PR CI and native qualification passed. No manual device/UI, performance or live Gateway behavior is claimed.

Historical evidence remains separate: the original 1910bd311468768a5bdf8f7290d838ed647eb9f8 head passed 108 local tests per flavor, but its first hosted attempt failed in Maven/UTP dependency resolution before execution. A same-head retry followed observed infrastructure recovery. Its accepted auto-merge request was explicitly retired before this replacement was published; neither old-head evidence nor that request qualifies the replacement head.

Current CI recovery

Current-head attempt 1 completed third-party unit tests successfully, then exceeded the job's 20-minute limit during Android app lint. The other selected jobs passed; lint completion was not established. The PR-only matrix had packed lint into the phone-test row. Native qualification run 45798910575 validated the same head through the existing four-row layout, with the same tasks and budgets. No repository setting or dependency changed.

Native qualification run 45798910575 completed successfully at the unchanged replacement head, including all four Android rows, both Access jobs, screenshot capture and required validation. The earlier timeout remains historical; it was not relabeled as successful.

The original source-event run also completed successfully on attempt 2 at the unchanged replacement head, including the previously cancelled third-party test/lint job and aggregate gate. The retry followed complete same-head qualification; no check was removed or overridden.

@vincentkoc vincentkoc self-assigned this Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review November 21, 2026 02:00
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 0758126e9451f3a6fad9c46bc6ffeb24096043db
  • Maintainer: @vincentkoc
  • Repository role: admin

These security sensitive changes were made:

  • apps/android/app/src/main/java/ai/openclaw/app/SecurePrefs.kt: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@vincentkoc
vincentkoc enabled auto-merge (squash) November 21, 2026 02:11
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Moves three generic Android JSON extensions from node utilities into the existing shared GatewayJson owner and updates their callers.

Example: Android reads a JSON primitive containing 42.

  • Before: The node-owned asStringOrNull extension returns "42".
  • After: The shared extension returns the same "42".

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch appears correct, with unchanged helper bodies and complete import migration; hosted validation remains incomplete and one native job is unattributed.
Proof confidence 🦐 gold shrimp (3/6) This internal refactor changes no user-visible behavior; supplied compilation and existing-suite results support equivalence, and no live-device claim requires verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Partial
Reason: Maintainer direction supports removing generic JSON dependencies on feature utilities; this PR delivers the campaign's JSON portion without expanding scope.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: the maintainer-authored refactor makes a complete, behavior-preserving ownership change, with no actionable patch findings; required CI remains unresolved.

Priority: P3
Reviewed head: 1910bd311468768a5bdf8f7290d838ed647eb9f8

Before merge

None.

Findings

None.

Agent review details

How this fits together

Android chat, Gateway, voice, Wear, settings, and node code consume parsed JSON elements; shared extensions project them into nullable objects, arrays, and primitive text.

flowchart LR
  A[Parsed JSON elements] --> B[Shared GatewayJson extensions]
  B --> C[Chat and Gateway consumers]
  B --> D[Voice and Wear consumers]
  B --> E[Settings and display models]
  B --> F[Node handlers]
Loading

Technical review

Best possible solution:

Retain this direct move into GatewayJson with unchanged coercion semantics and no parallel helper path.

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

This PR reports structural coupling rather than a runtime bug; source inspection confirms the original dependency and the complete caller migration.

Is this the best way to solve the issue?

The patch is the smallest complete change: reuse the existing JSON owner, move identical declarations, and update imports without adding machinery or tests.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ce30edafd0be.

Provenance checked

  • Generic object, array, and primitive-text readers keeps the original intent (c179f71: Historical Android improvements established node JSON helpers, and later shared-helper refactors reused their coercion contracts; this patch preserves those contracts exactly.)
  • Shared GatewayJson parsing owner keeps the original intent (d42b68d: refactor(android): deslop Android app #158539 consolidated repeated Android parsing while preserving behavior; subsequent cleanup retained strict-string versus permissive primitive parsing.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

PR surface

Source -13. Total -13 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 21 28 41 -13
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 28 41 -13

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: Internal ownership cleanup preserves application behavior and introduces no user-facing option or migration.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Inspect the failed 16 KiB native Access job and resolve its attribution before relying on the required CI gate.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 20, 2026, 9:16 PM ET / November 21, 2026, 02:16 UTC.

@vincentkoc
vincentkoc force-pushed the refactor/android-runtime-contracts-20261121 branch from 1910bd3 to 0758126 Compare November 26, 2026 09:45
@vincentkoc
vincentkoc merged commit 81bc5ec into main Nov 26, 2026
199 of 203 checks passed
@vincentkoc
vincentkoc deleted the refactor/android-runtime-contracts-20261121 branch November 26, 2026 10:55
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 26, 2026
* commit '399057400013dcfa1923db08be96c6bf46cf7079':
  fix: keep known speakers on meeting notes with missing labels (#205923)
  fix(codex): let saved conversations recover after a remote failure (#201621)
  fix: distinguish namesakes in Google Meet transcript exports (#205915)
  refactor: share Discord meeting transcript publication (#205921)
  test: trim workflow and runtime performance coverage (#205782)
  fix(android): settle startup before checking archive refresh (#205891)
  fix: Gateway retains completed reply runtimes after catalog reloads (#195479)
  fix: clear unused-export failures in dependency checks (#205905)
  refactor: share browser routing for meeting captions and cleanup (#205916)
  fix(ui): update Workshop file preview mode (#205872)
  refactor(android): decouple shared JSON values from node handlers (#202840)
  fix(ci): remove bot credit from release notes (#205914)
  fix: pause interrupted shell turns when their result is unknown (#205859)
  fix(ui): skip publication options for removed workspaces (#205909)
  fix: preserve indentation in document previews (#205834)
  improve(ci): avoid full fixture builds for volume checks (#205903)
  refactor(android): derive connection readiness from its owner (#202898)
vincentkoc added a commit that referenced this pull request Nov 26, 2026
…oid-chat-preview-grapheme-boundary

* commit '0bea7ecb3029583dd49d83f760d4f40c9e1f543c': (129 commits)
  fix(android): settle startup before checking archive refresh (#205891)
  fix: Gateway retains completed reply runtimes after catalog reloads (#195479)
  fix: clear unused-export failures in dependency checks (#205905)
  refactor: share browser routing for meeting captions and cleanup (#205916)
  fix(ui): update Workshop file preview mode (#205872)
  refactor(android): decouple shared JSON values from node handlers (#202840)
  fix(ci): remove bot credit from release notes (#205914)
  fix: pause interrupted shell turns when their result is unknown (#205859)
  fix(ui): skip publication options for removed workspaces (#205909)
  fix: preserve indentation in document previews (#205834)
  improve(ci): avoid full fixture builds for volume checks (#205903)
  refactor(android): derive connection readiness from its owner (#202898)
  fix: preserve side chat text when dictating at the limit (#205710)
  improve(telegram): polling workers start faster and use half the memory (#190890)
  fix: keep speaker identities distinct in meeting notes (#205860)
  fix: wait for cancellation before releasing ACP test preparation (#205893)
  fix: bound workers retained after deleting sessions across agents (#197409)
  fix(memory): keep a child's memory audience after its parent resets (#205887)
  refactor(android): give installed skills one data owner (#202892)
  fix(cli): share process failure listeners across invocations (#205732)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed 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