Skip to content

refactor(android): remove unused production helpers - #148233

Merged
roboclaw-bot merged 1 commit into
mainfrom
openclaw/android-readonly-cleanup-audit-20260914
Sep 14, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
openclaw/android-readonly-cleanup-audit-20260914

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Android retains unused helper methods alongside the implementations its app actually calls.

User Impact

No user-visible change. Settings, gateway connections, chat rewind, and attachment notices keep their current behavior.

Why This Change Was Made

Remove seven unreferenced methods without changing their active counterparts or lifecycle guards. This maintainer-requested production cleanup is independent of the build cleanup.

Evidence

  • Checked production, debug, flavor, test, manifest, and reflection references; the removed methods have no consumers.
  • Both phone flavors compiled and passed the seven selected test classes: 167 tests per flavor, zero failures, errors, or skips (334 executed total).
  • App ktlint and git diff --check passed.
  • Independent autoreview: scoped-clean through P2.
  • The full Android suite and device/UI tests were not run; this removes only unreferenced code.

Worked on by: @IWhatsskill

Remove seven unreferenced helpers while preserving active settings, gateway registry, rewind, and attachment notice behavior.

Co-authored-by: IWhatsskill <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 14, 2026 12:08
@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: XS maintainer Maintainer-authored PR labels Sep 14, 2026
@IWhatsskill IWhatsskill self-assigned this Sep 14, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 8:34 AM ET / 12:34 UTC.

ClawSweeper review

What this changes

Removes seven unused Android helper methods while preserving the active settings, connection, chat rewind, and attachment-notice paths.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, useful cleanup with no actionable correctness findings. Current main still contains the removed helpers, and the maintainer-labeled PR is protected from automatic closure.

Priority: P3
Reviewed head: b534bffa3f02dc33796e8b5bdcec5d82000f7f04

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused removal-only cleanup with preserved active callers and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied member/bot-authored cleanup is exempt from external-contributor runtime proof; source inspection confirms inactive methods are removed, and the reported flavor tests remain supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied member/bot-authored cleanup is exempt from external-contributor runtime proof; source inspection confirms inactive methods are removed, and the reported flavor tests remain supplemental validation.
Evidence reviewed 6 items Verified introduced scope: The merge-base-to-head diff contains only the seven helper removals supplied by the host; it introduces no replacement implementation, dependency, permission, configuration, or persistence change.
Active settings and rewind callers remain: MainViewModel writes display name, precise-location preference, and keep-awake preference directly to SecurePrefs. SettingsScreens calls those view-model methods. NodeRuntime.rewindChatAtEntry calls rewindSessionAtEntryResult, retaining its editor text, attachments, and existing lifecycle checks.
Attachment and session-key owners preserved: replaceAttachments still records Image notices through the private omission handler, while reportAttachmentOmission serves its existing callers. The live normalizeMainKey implementation is in ai.openclaw.app.SessionKey.kt; the deleted helper belonged to ai.openclaw.app.node.
Findings None None.
Security None None.

How this fits together

The Android app routes settings and chat actions through its view model, runtime, and local state owners. These owners update preferences, communicate with the Gateway, and publish chat state back to the interface.

flowchart TD
  A[Android user actions] --> B[View model]
  B --> C[Preferences]
  B --> D[Android runtime]
  D --> E[Gateway and chat controller]
  E --> F[Chat and attachment state]
  F --> G[Android interface]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other -36. Total -36 across 5 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 5 0 36 -36
Total 5 0 36 -36

Review metrics

None.

Technical review

Best possible solution:

Retain the active Android owners and remove these unreferenced convenience methods without adding compatibility wrappers or changing stored preferences.

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

Not applicable: this is unused-code cleanup, not a reported runtime bug; reference inspection supports the removal claim.

Is this the best way to solve the issue?

Yes: deleting the unused methods is the narrowest solution, and their active counterparts remain unchanged.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This removes unused internal Android methods without an intended user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied member/bot-authored cleanup is exempt from external-contributor runtime proof; source inspection confirms inactive methods are removed, and the reported flavor tests remain supplemental validation.

Label justifications:

  • P3: This removes unused internal Android methods without an intended user-visible behavior change.
  • 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: The supplied member/bot-authored cleanup is exempt from external-contributor runtime proof; source inspection confirms inactive methods are removed, and the reported flavor tests remain supplemental validation.

Evidence

What I checked:

  • Verified introduced scope: The merge-base-to-head diff contains only the seven helper removals supplied by the host; it introduces no replacement implementation, dependency, permission, configuration, or persistence change. (b534bffa3f02)
  • Active settings and rewind callers remain: MainViewModel writes display name, precise-location preference, and keep-awake preference directly to SecurePrefs. SettingsScreens calls those view-model methods. NodeRuntime.rewindChatAtEntry calls rewindSessionAtEntryResult, retaining its editor text, attachments, and existing lifecycle checks. (apps/android/app/src/main/java/ai/openclaw/app/MainViewModel.kt:713, b534bffa3f02)
  • Attachment and session-key owners preserved: replaceAttachments still records Image notices through the private omission handler, while reportAttachmentOmission serves its existing callers. The live normalizeMainKey implementation is in ai.openclaw.app.SessionKey.kt; the deleted helper belonged to ai.openclaw.app.node. (apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatComposerStateStore.kt:198, b534bffa3f02)
  • Cleanup remains absent from current main: All seven removed declarations remain at the fetched main revision. Comparing the five affected files against that revision yields the same removal-only patch; this is behavioral context, not the basis for attributing introduced changes. (apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:3774, bb988a2535fe)
  • Area-history routing: Available main history records Peter Steinberger on composer ownership, attachment restoration, multi-gateway support, and recent picker coordination work. Exact source-line attribution could not be completed because deeper blame/history attempted to retrieve an unavailable object; no introduction claim is made. (apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatComposerStateStore.kt, 36de76610c25)
  • Validation and discussion: The fully supplied PR body reports compilation and 334 selected test executions across both phone flavors, plus ktlint and diff checks; it explicitly excludes full-suite and device testing. These are author-reported results, not reviewer execution. Reviewer git diff --check passed. The supplied discussion contains no human review findings or linked replacement; a supplemental GitHub search was blocked by the managed proxy. (b534bffa3f02)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@roboclaw-bot
roboclaw-bot merged commit bfaac10 into main Sep 14, 2026
114 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/android-readonly-cleanup-audit-20260914 branch September 14, 2026 15:55
@roboclaw-bot

roboclaw-bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Merged via squash.


Maintainer review before landing focused on whether these seven unused methods can be removed without changing the active Android settings, connection, rewind, or attachment paths:

  • Removes the unreferenced entry points themselves rather than adding wrappers or changing their active replacements. Production, debug, flavor, test, manifest, and reflection references were checked.
  • node/NodeUtils.kt::normalizeMainKey was an unused alternative to SessionKey.kt; the removed NodeRuntime setters were bypassed by MainViewModel writing to SecurePrefs. GatewayRegistryStore.connectedEntries, the text-only rewind wrapper, and reportImageOmission likewise had no consumers. These were obsolete source surfaces, not a demonstrated user-visible runtime bug.
  • Both phone flavors compiled and passed 167 selected tests each (334 executions, no failures/errors/skips): NodeUtilsTest, SessionKeyTest, MainViewModelTest, GatewayRegistryStoreTest, ChatComposerDraftTest, ChatControllerSessionActionsTest, and ChatControllerBranchCoordinationTest. Together with the reference check, these cover the retained settings, registry, draft, rewind, and branch-ownership behavior. App ktlint and independent review through P2 passed.
  • Deliberately did not unify the two session-key normalizers: the removed variant returned null for blank input, whereas the active owner returns main. The debug manual-connection setters, rewind-result attachments, and outbox/owner guards were retained.

Merge-blocking checks were green on the merged head: openclaw/ci-gate.

Not covered: physical-device end-to-end flows or measured APK-size, startup-time, or memory-use improvements. Local validation used the seven selected classes per flavor, not a manual acceptance pass of the whole app.

This completes the audited unused-production-method cleanup; PR #148231 covers the separate test/build cleanup.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit '3c08384584f57787a26da9998488233fc15ccf7e': (122 commits)
  fix(agents): keep tool result summaries when middleware details exceed shape limits (#147805)
  test: make full-suite fixtures portable across runtimes (#148247)
  refactor(qa): share unknown confidence results (#148200)
  chore(android): remove unused test dependencies and duplicate Wear settings (#148231)
  test: reuse compiled preflight in startup fixtures (#148330)
  test(wizard): route recovery integration through database forks (#148337)
  refactor(plugins): simplify provider auth patch recursion (#147933)
  fix(cli): drain failed web capability output (#148234)
  refactor(android): remove unused production helpers (#148233)
  fix(plugins): scope feed integrity to hosted ClawHub (#148220)
  test(qa): compare Telegram entities semantically (#148219)
  test(qa): recognize native Slack exec progress rows (#148217)
  test(cron): distinguish repeated delivery incidents (#148151)
  test(qa): preserve restart command ownership (#148218)
  test(qa): isolate bundled skill CLI gateway state (#148150)
  test(qa): align process lifecycle contracts (#148149)
  improve(media): reduce metadata fetched during orphan cleanup (#148244)
  fix(matrix): retain sync state runtime for deferred persistence (#148152)
  test: deduplicate gateway watch exit fixtures (#148237)
  refactor(cli): derive daemon status contract from gatherer (#148108)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Remove seven unreferenced helpers while preserving active settings, gateway registry, rewind, and attachment notice behavior.

Co-authored-by: IWhatsskill <[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 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: XS 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