Skip to content

refactor(android): remove retired voice UI and unify command ownership - #136192

Merged
steipete merged 3 commits into
mainfrom
codex/android-deeper-deslop-20260902
Sep 2, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/android-deeper-deslop-20260902

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android still carried a standalone Voice screen even though every entry point has routed to unified Chat since July. Native commands also had separate advertisement and dispatch definitions, and the two permission dialogs duplicated their activity/cancellation lifecycle. This is the deeper, behavior-preserving cleanup following #136078.

Why This Change Was Made

Delete the retired Voice UI and its unused ViewModel/runtime bindings. Keep the active Chat composer, dictation, voice notes, Talk, push-to-talk, and Wear paths. Normalize the shipped saved Voice destination only when restoring navigation state, rather than retaining an unreachable runtime tab.

Bind each native command to its handler and availability gate in one ordered dispatcher table. Connection setup consumes that table; invocation still rechecks current availability. Preserve command/capability ordering, foreground error precedence, the promptable SMS-search distinction, flavor gates, and handler errors/cancellation. Sample shared gates once per advertised list so one setting change cannot split a command family.

Share the rationale and Settings dialogs' lifecycle waiter while preserving their different outcomes, activation-generation checks, main-thread dismissal, cancellation, and request-code ownership. Remove obsolete tests for the deleted implementation and keep behavioral coverage at the live owners.

User Impact

No intended layout, feature, permission-policy, or protocol change. The compact unified composer remains the only chat/voice surface. Old saved Voice destinations still restore to Chat. No dependencies, configuration options, persistent-store schemas, or release artifacts change.

Android production code: +255 / -2,257 = -2,002 lines. Tests: +275 / -643 = -368. Tooling: -4. Generated source inventory: -44. Total: 2,418 fewer lines across 19 files; this is deletion/consolidation, not file moves or formatting compression.

The separate forced-health-check race remains tracked in #136047; this PR does not claim to fix it.

Evidence

Candidate: 155e6ca5f06fd3c846e3d681c1904846e5f5d025, based on c35350c92d8609d28dfcf190197ec22583e62ea3.

  • Baseline: both debug APKs built and 102 focused tests passed before applying the patch.
  • Final candidate: 5,419 tests passed, zero failures/errors/skips: Play 2,557; ThirdParty 2,688; Wear 164; wear-shared 10. Both app-flavor suites reran after the ACK-fixture correction; unchanged Wear results were up to date. The final TypeScript-fixture-only edit leaves that Android test tree byte-identical. Both debug APKs built. All four module Kotlin style checks and both app-flavor/Wear lint checks passed before that correction; app Kotlin style and 178 focused branch/reconnect tests also passed after it.
  • Focused coverage includes real Robolectric dialog cancellation and recovery, activity replacement/request-code isolation, saved Voice destinations, ordered advertisements, changing gates, foreground rejection precedence, opaque handler parameters, and exception/cancellation propagation.
  • All 60 native/Android/Apple inventory tests passed after reproducing the stale Voice-label assertion failure. Kotlin conditional extraction stays covered by a synthetic two-branch fixture. The actual changed-file checks (root test types, scripts/test lint, formatting and repository guards) passed.
  • Native source-inventory verification passed. Managed locale catalogs are intentionally left to the repository's post-merge locale refresh.
  • Codex autoreview completed clean at the repository's default P0 scope. Independent source review also checked all command bindings, connection metadata, navigation reachability, and permission lifecycle ownership.

Local Android command, through the repository wrapper (the two focused APK builds and Kotlin style checks ran separately):

node --import ./scripts/tsx.mjs scripts/run-android-gradle.mts \
  --no-daemon --max-workers=2 \
  :app:testPlayDebugUnitTest :app:testThirdPartyDebugUnitTest \
  :wear:testDebugUnitTest :wear-shared:testDebugUnitTest \
  :app:lintPlayDebug :app:lintThirdPartyDebug \
  :wear:lintDebug :wear-shared:lintDebug
node --import ./scripts/tsx.mjs scripts/native-app-i18n.ts verify

Native live proof

Fresh API 36 emulator, 320dp, normal native onboarding/pairing and retained-data APK upgrades. The APKs were built from an isolated c35350c92d86 checkout with the candidate patch applied; all tracked Android sources matched committed candidate bac34e0909e1. The debug About stamp names that build checkout. Subsequent changes only repair tests, so the final production source is unchanged. The real isolated Gateway is pinned to 36eb0c1ec3fc, with a loopback scripted provider and synthetic data only.

  • Home Talk and the legacy Voice intent open unified Chat. Editor, attachment, model and Talk bounds match the baseline exactly.
  • With the same pre-grant state, raw connect commands, capabilities, ordering and Boolean permissions match exactly in both flavors: Play 18 commands / 7 capabilities; ThirdParty 21 / 9. Gateway-filtered lists were recorded separately.
  • Actual SMS denial returns SMS_PERMISSION_REQUIRED. Rationale and Settings dialogs both recover after Home/reopen and cancel normally. Leaving each dialog untouched returns TIMEOUT near 20 seconds, dismisses the dialog, and permits the next request.
  • Open Settings reaches the real Android App info screen. Granting SMS there, returning with Back, and retrying sms.search returns ok: true, count: 0, messages: [] in 67 ms. Only read-only search was opted into the fixture Gateway; no SMS send was invoked.
  • A normal typed send completes through the real Gateway and loopback provider. The reply renders, the run finishes, and both messages survive a cold app restart. The actual keyboard composer and model sheet were also inspected.
  • Talk reaches the real microphone prompt; denial leaves usable Chat. Unavailable AOSP speech recognition offers the voice-note alternative. Voice-note permission denial is visible rather than a dead end.

Same viewport and display width before and after; this refactor does not enlarge or move the composer:

Before After
Before: unified Android Chat at 320dp After: unchanged unified Android Chat at 320dp

Proof limits: no physical phone is attached. This AOSP emulator lacks an on-device speech recognizer and runs without audio; microphone/camera remain denied. This proves native routing, permission flows and recovery, not successful physical audio or external-provider transcription. The pinned Gateway is a real counterpart, not a claim to test current Gateway core.

CI follow-up

The first full CI run exposed a pre-existing setup race in the orphan-retirement test: durable send admission can return while the flush lane is still persisting its acknowledgement. The fixture now waits for the actual persisted Accepted state before advancing; the existing timeout and all retirement/FIFO assertions are unchanged. No production change was needed. The full local matrix and fresh Codex review pass with this correction.

The Node shard in that run failed because the inventory test still required Mute, whose sole source was the deleted Voice screen. That global assertion is removed; its original Kotlin conditional-extraction coverage is preserved in the existing synthetic scanner fixture, including both joined branch values and rejection of partial fragments. All 60 owner/sibling inventory tests and source-inventory verification pass.

All six Android lanes and every Node shard passed in CI run 33616634228 on 155e6ca5f06f. Its security job failed before hooks ran while fetching the pinned pre-commit dependency; the workflow/config are unchanged, and the exact dependency tag is reachable. The failed-check rerun then hit a GitHub internal startup error and launched no jobs. The PR was closed/reopened once to request fresh normal CI on the unchanged commit. Fresh normal PR CI run 33618775168 passed on the same 155e6ca5f06f head. All 140 build/test jobs passed in attempt 1; its security job failed while fetching PR scan history, before scanning. After the run finished, a security-only retry passed, followed by the required openclaw/ci-gate at 10:40 UTC. No code or security checks changed for either infrastructure recovery. GitHub’s jobs-list endpoint briefly returned 502s; the official run and check-suite results independently confirm completed success. The latest exact-head ClawSweeper review has no code/security findings; its remaining CI requirement is satisfied. The draft-event run was skipped and is not counted as proof.

All isolated live-proof processes, listeners, reverse mappings, and synthetic credentials have been cleaned up; reviewed evidence is retained.

Delete the unreachable standalone Voice screen and its facade bindings while preserving the unified Chat voice flows and saved Voice destination restore contract.

Bind advertised commands and invocation to one ordered dispatcher table, and share the permission dialog lifecycle without changing foreground, capability, permission, or cancellation behavior.
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Sep 2, 2026
@steipete
steipete marked this pull request as ready for review September 2, 2026 09:10
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 6:33 AM ET / 10:33 UTC.

ClawSweeper review

What this changes

Removes Android’s retired Voice screen, consolidates node command advertisement and dispatch into one table, and shares permission-dialog lifecycle handling while preserving existing chat and voice flows.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. This is a still-needed Android refactor: current main still contains the retired Voice screen, while this branch moves command advertising and invocation to one owner and preserves legacy navigation restoration. No discrete correctness defect was found; landing remains gated on the incomplete exact-head required-check rollup.

Priority: P3
Reviewed head: 155e6ca5f06fd3c846e3d681c1904846e5f5d025

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A well-scoped, net-negative refactor with owner-boundary coverage and detailed native evidence; only the normal exact-head CI gate remains.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The changed Android owners are exercised through the packaged app’s legacy Voice intent, unified Chat, Gateway command routing, and real Android permission flows on an API 36 emulator; the supplied after-fix observations include successful recovery and retained Chat behavior, with physical-audio limits stated.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed Android owners are exercised through the packaged app’s legacy Voice intent, unified Chat, Gateway command routing, and real Android permission flows on an API 36 emulator; the supplied after-fix observations include successful recovery and retained Chat behavior, with physical-audio limits stated.
Evidence reviewed 6 items Current-main necessity check: The PR head is not an ancestor of fetched main, and the fetched-main tree still contains the retired Voice screen; current main has not already absorbed this branch’s central deletion.
Single command-owner boundary: The dispatcher owns ordered command bindings, advertisement gates, and invocation-time rechecks; NodeRuntime supplies these same builders to its connection manager and routes Gateway invokes back through the dispatcher.
Legacy navigation compatibility: Saved Voice destinations are normalized only while restoring ShellNavigation state, leaving all live navigation values on the remaining tab set.
Findings None None.
Security None None.

How this fits together

The Android app connects a device node to the Gateway and exposes phone capabilities through advertised commands that are later invoked by the Gateway. Shell navigation routes app and legacy intents into the unified Chat surface, while the permission requester coordinates Android prompts for those commands.

flowchart LR
  A[Android launch or saved state] --> B[Shell navigation]
  B --> C[Unified Chat]
  D[Gateway node connection] --> E[Command dispatcher]
  E --> F[Advertised commands and capabilities]
  E --> G[Permission and device handlers]
  G --> H[Gateway invoke result]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head required-check rollup is incomplete, so the branch is not yet ready to land despite the supplied focused and live evidence.
  • Complete next step (P2) - Wait for the exact-head required checks to complete successfully before merge.
Agent review details

Security

None.

PR surface

Tests -368, Other -2050. Total -2418 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 8 275 643 -368
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 11 281 2331 -2050
Total 19 556 2974 -2418

Review metrics

Metric Value Why it matters
Production versus test delta production −2,002; tests −368; tooling −4; generated inventory −44 The branch is a net-negative owner-boundary consolidation rather than production growth.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the single Android command owner and restore-only legacy Voice mapping, then merge once the exact-head required checks are complete and green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the single Android command owner and restore-only legacy Voice mapping, then merge once the exact-head required checks are complete and green.

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

Yes. The supplied exact-head API 36 emulator evidence exercises the affected navigation, permission, command, and Chat flows after the refactor.

Is this the best way to solve the issue?

Yes. Consolidating advertisement and dispatch at the dispatcher removes the duplicated ownership while restoration-only mapping preserves the legacy saved-navigation contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed Android owners are exercised through the packaged app’s legacy Voice intent, unified Chat, Gateway command routing, and real Android permission flows on an API 36 emulator; the supplied after-fix observations include successful recovery and retained Chat behavior, with physical-audio limits stated.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This is a behavior-preserving Android cleanup with substantial validation, not an active user-facing regression.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed Android owners are exercised through the packaged app’s legacy Voice intent, unified Chat, Gateway command routing, and real Android permission flows on an API 36 emulator; the supplied after-fix observations include successful recovery and retained Chat behavior, with physical-audio limits stated.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Android owners are exercised through the packaged app’s legacy Voice intent, unified Chat, Gateway command routing, and real Android permission flows on an API 36 emulator; the supplied after-fix observations include successful recovery and retained Chat behavior, with physical-audio limits stated.

Evidence

What I checked:

Likely related people:

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

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-02T09:27:18.705Z sha bac34e0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T09:42:28.979Z sha d47dd9f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T10:01:45.725Z sha 155e6ca :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T10:26:28.928Z sha 155e6ca :: needs maintainer review before merge. :: none

Durable admission may return while the FIFO flush owns an in-flight send. Publish its history evidence before waiting for the persisted Accepted state, using the existing bounded helper and preserving the strict retirement and FIFO assertions.

Observed in ThirdParty CI run 33612639217; both branch-coordination and reconnect-restore suites pass after the synchronization fix.
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@steipete steipete closed this Sep 2, 2026
@steipete steipete reopened this Sep 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 2, 2026
@steipete
steipete merged commit 64807af into main Sep 2, 2026
560 of 565 checks passed
@steipete
steipete deleted the codex/android-deeper-deslop-20260902 branch September 2, 2026 10:47
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 2, 2026
Keep forced Refresh health checks alive across superseding, failed, or
cancelled history requests. Controller-owned work survives a UI caller
stopping its await; connection and selected-session leases fence results.

Retire confirmed Room outbox rows before unrelated history-tail RPCs, then
wake the existing single-flight dispatcher on every valid healthy result.
This preserves branch safety without losing a queued successor when a
terminal event cancels its history waiter.

Remove redundant confirmation/publication, reconnect-only completion,
bootstrap wrappers, and the always-true clearMessages option. Cover the
owner boundaries with failing-before/passing-after Room regressions and
native Refresh, failure, recovery, and exactly-once delivery evidence.

Closes #136047. Follow-up to #136192.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
openclaw#136192)

* refactor(android): remove retired voice UI and unify command ownership

Delete the unreachable standalone Voice screen and its facade bindings while preserving the unified Chat voice flows and saved Voice destination restore contract.

Bind advertised commands and invocation to one ordered dispatcher table, and share the permission dialog lifecycle without changing foreground, capability, permission, or cancellation behavior.

* test(android): await persisted send acknowledgement in orphan fixture

Durable admission may return while the FIFO flush owns an in-flight send. Publish its history evidence before waiting for the persisted Accepted state, using the existing bounded helper and preserving the strict retirement and FIFO assertions.

Observed in ThirdParty CI run 33612639217; both branch-coordination and reconnect-restore suites pass after the synchronization fix.

* test(i18n): decouple conditional coverage from retired voice UI
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…aw#136413)

Keep forced Refresh health checks alive across superseding, failed, or
cancelled history requests. Controller-owned work survives a UI caller
stopping its await; connection and selected-session leases fence results.

Retire confirmed Room outbox rows before unrelated history-tail RPCs, then
wake the existing single-flight dispatcher on every valid healthy result.
This preserves branch safety without losing a queued successor when a
terminal event cancels its history waiter.

Remove redundant confirmation/publication, reconnect-only completion,
bootstrap wrappers, and the always-true clearMessages option. Cover the
owner boundaries with failing-before/passing-after Room regressions and
native Refresh, failure, recovery, and exactly-once delivery evidence.

Closes openclaw#136047. Follow-up to openclaw#136192.
steipete added a commit that referenced this pull request Oct 13, 2026
Remove duplicate visibility/cache/startup state and unreachable platform/encoder fallbacks in old iOS and Android files. Share outside-tap recognition and let the node invoke boundary own mirrored-notification normalization.

Keep physical-route authorization, permission checks, durable Watch admission and ACKs, FIFO sends, protocol/data shapes, and ordinary concurrency. Net production reduction: 289 LOC, excluding tests, fixtures, and generated files.

Proof: iPhone app/Share/embedded Watch builds, final 273 invoke/Watch ingress/delegate/location tests and 74 sidebar/dashboard tests; Watch scheme build and 11 media tests; Android APK and 89 distinct focused unit cases; 18 shared source-resource tests. Changed-file guards, native lint, runtime/Madge cycles (zero), lint-suppressions (3 tests), and final independent P0-P2 review pass. No hosted CI or hardware/provider-audio/battery proof is claimed.

Best-effort tradeoffs accepted:
- Observer declarations (#113634): synthetic stale-ACK fencing is replaced by FIFO sends and subscription/reconnect replay; failed or obsolete metadata heals on the next declaration.
- Dashboard refresh (#111339): the sole SwiftUI refresh task is sequential and cancellation-owned, so a second generation counter is redundant; a future concurrent direct caller must cancel prior work or accept last-completing cosmetic data until refresh. Roster event/mutation overlap still retains its own generation.
- Delayed cosmetic actions (#113062): the synthetic post-delay interleaving no longer needs generations; replacing an action does not revoke work that already started.
- Delayed gate lifetime (#113062): both real view owners cancel on disappearance, so a second weak-gate lifetime condition is redundant; a future caller omitting cancellation may still perform a harmless cosmetic completion after releasing its gate.
- Watch one-shot transport (#135808): cancelled instances cannot restart, so generations add no supported lifetime; cancellation and physical-resource checks remain.
- Command advertisements (#136192): the synthetic synchronous preference flip may briefly split a command family until reconnect; live invocation admission remains.
- Turn recaps (#112221/#113084): synthetic metadata-only mode and a duplicated pending terminal value are removed; the sole production caller always provides transcript facts, and same-timestamp metadata corrections now use the latest authoritative session row. History/terminal attribution, settlement bounds and all 21 retained tests remain.
- Realtime coordinator (#111033): direct concurrent reset/reuse is unsupported by serialized phone/Wear callers; current-session, duplicate-run, and live-submit guards remain.
- Network availability (#138732): an unexpected duplicate SDK AVAILABLE may wake offline retry early; the human battery fix (#127872), retry ladder, and current-session admission remain.
- iOS resource adapter (#148906): a captured invalidated loader may redundantly reload current metadata; the shared cache owner still cancels stale in-flight results and live authority remains checked.
- Watch startup buffer (5e9bc09): synchronous MainActor registration cannot interleave with queued inbound delivery; a future caller yielding before registration may drop ephemeral requests, never ACK uncommitted chat.
- Mirror validation (#23636): the sole caller supplies normalized bounded fields; future internal callers must preserve that precondition.
- Beacon payload UTF-8 (#73330): Foundation JSONEncoder guarantees the bytes; a framework contract violation is an internal failure, not a recoverable conversion branch.
- Beacon envelope UTF-8 (#73330): the same guarantee removes the second conversion fallback; actual encoding errors still throw.
- Watch request UTF-8 (#135808): default encoder output cannot fail UTF-8 conversion; actual encoding errors still throw.
- Location event UTF-8 (#18260): default encoder output cannot fail UTF-8 conversion; nonfinite-value encoding failures keep their existing handling.
- HealthKit identifiers (#105616): fixed supported identifiers use nonfailable SDK constructors; authorization, privacy scope, and queries remain unchanged.
- Pre-iOS26 button fallback (#168595): the existing native deployment floor is26.2, so supported rendering is unchanged.
- Pre-Android26 priority fallback (#29398): the app minimum is31; notification-channel importance remains the active owner.
- WebView task document fences (#139514): existing MainActor cancellation-at-effect already rejects retired callbacks; navigation and document authority remain.

(cherry picked from commit 3dd5a00)
steipete added a commit that referenced this pull request Oct 13, 2026
…el and native code (#170815)

* fix(signal): reserve canonical default transport during legacy cleanup

Keep the canonical root transport in managed-port reservations when a nested
default account still carries retired transport fields. Otherwise Doctor can
allocate the default port to an implicit sibling and produce a collision.

Cover synchronous and asynchronous Doctor migration, nested-field cleanup,
and resolving both accounts to distinct ports. No new configuration surface
or persisted format; existing update/Doctor ownership stays authoritative.

* fix(channels): keep message content out of transport diagnostics

Remove raw content from IRC line/NOTICE, WhatsApp mention/skip, LINE inbound
and postback, Twitch callback, iMessage echo, and Tlon settings diagnostics.
Retain metadata and the complete payload in its delivery/history owner.
LINE peer routing also consumes already prepared source facts instead of
reinspecting the same source through a one-use helper.

Extend existing owning-boundary tests, including real IRC sockets, rather
than adding a separate logging implementation. IRC, WhatsApp, and Tlon
privacy probes failed on the old path and pass with content preserved.

* refactor(channels): simplify old transport helpers and lifecycle state

Consolidate Matrix send preparation, Zalo account/error traversal onto
existing SDK seams, and Google Meet CLI dispatch. Remove pass-through
Promise wrappers, duplicate lifecycle facts, and internal clock defenses.
Keep transport validation, effect authority, FIFO and durable shutdown.

Best-effort tradeoffs accepted:
- Internal cache/follow-up clocks are ordinary Date.now plus constant TTLs;
  synthetic invalid-clock cases are not actual-use incidents. A corrupt clock
  may distort metadata expiry until repair/restart.
- FaceTime does not fence unsupported start-before-stop reentry; its runtime
  creates a new supervisor after joined shutdown. Initial feature #119291
  introduced the generation, without a human reentry incident.
- LINE uses timer cancellation and its stop Promise, not a second stopped
  flag. Synchronous stop reentry is not performed by production callers.
- Mattermost uses one stopped fact, recursive polling and native Promise
  settlement; synchronous callbacks cannot interleave with cancellation.
- Teams uses a fresh UUID without reparsing text to reject a theoretical
  authored-placeholder collision; no human collision report was identified.
- FaceTime expects the documented system_profiler JSON output; malformed
  output reports missing devices instead of parsing old plaintext fixtures.
- Feishu serialization rejects cycles before element counting; exotic
  getter/toJSON objects remain best effort rather than a second graph walk.
- Zalo shares SDK error traversal; provider errors with throwing cause
  getters remain best effort rather than a private short-circuit walker.
- ClickClack uses the timeout race winner directly; exact-deadline late
  microtasks can discard stale ephemeral details, never the durable reply.
- Raft's private FIFO settles replay commits before another claim. If that
  invariant were violated, an unexpected inflight wake is a duplicate hint
  rather than a second settlement path. #109117 gives synthetic/generic
  ownership reasoning, not a human actual-use incident.

Old-code lane o07: production files checked against the last-seven-day
origin/main inventory. No SDK exports, dependencies, schemas or protocols
changed. Standalone session memory remains untouched.

* refactor(mobile): simplify old native lifecycle bookkeeping

Remove duplicate visibility/cache/startup state and unreachable platform/encoder fallbacks in old iOS and Android files. Share outside-tap recognition and let the node invoke boundary own mirrored-notification normalization.

Keep physical-route authorization, permission checks, durable Watch admission and ACKs, FIFO sends, protocol/data shapes, and ordinary concurrency. Net production reduction: 289 LOC, excluding tests, fixtures, and generated files.

Proof: iPhone app/Share/embedded Watch builds, final 273 invoke/Watch ingress/delegate/location tests and 74 sidebar/dashboard tests; Watch scheme build and 11 media tests; Android APK and 89 distinct focused unit cases; 18 shared source-resource tests. Changed-file guards, native lint, runtime/Madge cycles (zero), lint-suppressions (3 tests), and final independent P0-P2 review pass. No hosted CI or hardware/provider-audio/battery proof is claimed.

Best-effort tradeoffs accepted:
- Observer declarations (#113634): synthetic stale-ACK fencing is replaced by FIFO sends and subscription/reconnect replay; failed or obsolete metadata heals on the next declaration.
- Dashboard refresh (#111339): the sole SwiftUI refresh task is sequential and cancellation-owned, so a second generation counter is redundant; a future concurrent direct caller must cancel prior work or accept last-completing cosmetic data until refresh. Roster event/mutation overlap still retains its own generation.
- Delayed cosmetic actions (#113062): the synthetic post-delay interleaving no longer needs generations; replacing an action does not revoke work that already started.
- Delayed gate lifetime (#113062): both real view owners cancel on disappearance, so a second weak-gate lifetime condition is redundant; a future caller omitting cancellation may still perform a harmless cosmetic completion after releasing its gate.
- Watch one-shot transport (#135808): cancelled instances cannot restart, so generations add no supported lifetime; cancellation and physical-resource checks remain.
- Command advertisements (#136192): the synthetic synchronous preference flip may briefly split a command family until reconnect; live invocation admission remains.
- Turn recaps (#112221/#113084): synthetic metadata-only mode and a duplicated pending terminal value are removed; the sole production caller always provides transcript facts, and same-timestamp metadata corrections now use the latest authoritative session row. History/terminal attribution, settlement bounds and all 21 retained tests remain.
- Realtime coordinator (#111033): direct concurrent reset/reuse is unsupported by serialized phone/Wear callers; current-session, duplicate-run, and live-submit guards remain.
- Network availability (#138732): an unexpected duplicate SDK AVAILABLE may wake offline retry early; the human battery fix (#127872), retry ladder, and current-session admission remain.
- iOS resource adapter (#148906): a captured invalidated loader may redundantly reload current metadata; the shared cache owner still cancels stale in-flight results and live authority remains checked.
- Watch startup buffer (5e9bc09): synchronous MainActor registration cannot interleave with queued inbound delivery; a future caller yielding before registration may drop ephemeral requests, never ACK uncommitted chat.
- Mirror validation (#23636): the sole caller supplies normalized bounded fields; future internal callers must preserve that precondition.
- Beacon payload UTF-8 (#73330): Foundation JSONEncoder guarantees the bytes; a framework contract violation is an internal failure, not a recoverable conversion branch.
- Beacon envelope UTF-8 (#73330): the same guarantee removes the second conversion fallback; actual encoding errors still throw.
- Watch request UTF-8 (#135808): default encoder output cannot fail UTF-8 conversion; actual encoding errors still throw.
- Location event UTF-8 (#18260): default encoder output cannot fail UTF-8 conversion; nonfinite-value encoding failures keep their existing handling.
- HealthKit identifiers (#105616): fixed supported identifiers use nonfailable SDK constructors; authorization, privacy scope, and queries remain unchanged.
- Pre-iOS26 button fallback (#168595): the existing native deployment floor is26.2, so supported rendering is unchanged.
- Pre-Android26 priority fallback (#29398): the app minimum is31; notification-channel importance remains the active owner.
- WebView task document fences (#139514): existing MainActor cancellation-at-effect already rejects retired callbacks; navigation and document authority remain.

(cherry picked from commit 3dd5a00)

* refactor(ios): keep delayed cosmetic actions synchronous

Both production callers update toast or flash state synchronously on MainActor. Remove the unused async action contract and invoke it directly after the existing sleep/cancellation boundary. Keep asynchronous sleeping, cancellation, replacement and the returned task unchanged.

Best-effort tradeoffs accepted:
- None added by this type narrowing. The helper is internal, both callers and all retained tests already supply synchronous actions. The hypothetical suspending action discussed with #113062 is not a supported caller and is no longer expressible through this API.

Earlier guard-removal provenance and campaign proof are recorded in the preceding mobile cleanup commit. This follow-up changes no production LOC total, public protocol, permission, signing, dependency, persistence or visible rendering.

Validation: iPhone app/Share/embedded Watch build and61 focused tests in2 suites pass (DelayedActionGateTests and RootTabsPresentationTests),196.654s xcodebuild/0.628s tests. Configured SwiftFormat and strict SwiftLint pass; independent P0-P2 review is scoped-clean. Earlier unchanged-input changed-file, cycle and lint-suppression gates remain valid.
(cherry picked from commit c7c9fb6)

* fix(mattermost): keep inbound message content out of diagnostics

Log conversation, post ID and length instead of a body preview. Keep the
complete agent body and attachment order unchanged, and update the existing
monitor boundary test to reject content in diagnostics.

The regression fails before the repair on the leaked synthetic body prefix
after complete-body/ordered-media assertions pass, then passes after repair.
Final owner24, sibling25 and lint-suppressions3 tests pass; runtime and Madge
cycles are zero. Fresh production/test types, syntax lint, format and line-cap
checks pass, with no baseline, suppression or timeout increase.

This minimal privacy fix is explicitly authorized outside the old-code
eligibility restriction. The combined channel/native patch received a fresh
independent review with no actionable P0-P2 findings.

* fix(ios): remove retired Watch error from i18n inventory

* fix(mattermost): normalize nullable shutdown cleanup before await
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…el and native code (openclaw#170815)

* fix(signal): reserve canonical default transport during legacy cleanup

Keep the canonical root transport in managed-port reservations when a nested
default account still carries retired transport fields. Otherwise Doctor can
allocate the default port to an implicit sibling and produce a collision.

Cover synchronous and asynchronous Doctor migration, nested-field cleanup,
and resolving both accounts to distinct ports. No new configuration surface
or persisted format; existing update/Doctor ownership stays authoritative.

* fix(channels): keep message content out of transport diagnostics

Remove raw content from IRC line/NOTICE, WhatsApp mention/skip, LINE inbound
and postback, Twitch callback, iMessage echo, and Tlon settings diagnostics.
Retain metadata and the complete payload in its delivery/history owner.
LINE peer routing also consumes already prepared source facts instead of
reinspecting the same source through a one-use helper.

Extend existing owning-boundary tests, including real IRC sockets, rather
than adding a separate logging implementation. IRC, WhatsApp, and Tlon
privacy probes failed on the old path and pass with content preserved.

* refactor(channels): simplify old transport helpers and lifecycle state

Consolidate Matrix send preparation, Zalo account/error traversal onto
existing SDK seams, and Google Meet CLI dispatch. Remove pass-through
Promise wrappers, duplicate lifecycle facts, and internal clock defenses.
Keep transport validation, effect authority, FIFO and durable shutdown.

Best-effort tradeoffs accepted:
- Internal cache/follow-up clocks are ordinary Date.now plus constant TTLs;
  synthetic invalid-clock cases are not actual-use incidents. A corrupt clock
  may distort metadata expiry until repair/restart.
- FaceTime does not fence unsupported start-before-stop reentry; its runtime
  creates a new supervisor after joined shutdown. Initial feature openclaw#119291
  introduced the generation, without a human reentry incident.
- LINE uses timer cancellation and its stop Promise, not a second stopped
  flag. Synchronous stop reentry is not performed by production callers.
- Mattermost uses one stopped fact, recursive polling and native Promise
  settlement; synchronous callbacks cannot interleave with cancellation.
- Teams uses a fresh UUID without reparsing text to reject a theoretical
  authored-placeholder collision; no human collision report was identified.
- FaceTime expects the documented system_profiler JSON output; malformed
  output reports missing devices instead of parsing old plaintext fixtures.
- Feishu serialization rejects cycles before element counting; exotic
  getter/toJSON objects remain best effort rather than a second graph walk.
- Zalo shares SDK error traversal; provider errors with throwing cause
  getters remain best effort rather than a private short-circuit walker.
- ClickClack uses the timeout race winner directly; exact-deadline late
  microtasks can discard stale ephemeral details, never the durable reply.
- Raft's private FIFO settles replay commits before another claim. If that
  invariant were violated, an unexpected inflight wake is a duplicate hint
  rather than a second settlement path. openclaw#109117 gives synthetic/generic
  ownership reasoning, not a human actual-use incident.

Old-code lane o07: production files checked against the last-seven-day
origin/main inventory. No SDK exports, dependencies, schemas or protocols
changed. Standalone session memory remains untouched.

* refactor(mobile): simplify old native lifecycle bookkeeping

Remove duplicate visibility/cache/startup state and unreachable platform/encoder fallbacks in old iOS and Android files. Share outside-tap recognition and let the node invoke boundary own mirrored-notification normalization.

Keep physical-route authorization, permission checks, durable Watch admission and ACKs, FIFO sends, protocol/data shapes, and ordinary concurrency. Net production reduction: 289 LOC, excluding tests, fixtures, and generated files.

Proof: iPhone app/Share/embedded Watch builds, final 273 invoke/Watch ingress/delegate/location tests and 74 sidebar/dashboard tests; Watch scheme build and 11 media tests; Android APK and 89 distinct focused unit cases; 18 shared source-resource tests. Changed-file guards, native lint, runtime/Madge cycles (zero), lint-suppressions (3 tests), and final independent P0-P2 review pass. No hosted CI or hardware/provider-audio/battery proof is claimed.

Best-effort tradeoffs accepted:
- Observer declarations (openclaw#113634): synthetic stale-ACK fencing is replaced by FIFO sends and subscription/reconnect replay; failed or obsolete metadata heals on the next declaration.
- Dashboard refresh (openclaw#111339): the sole SwiftUI refresh task is sequential and cancellation-owned, so a second generation counter is redundant; a future concurrent direct caller must cancel prior work or accept last-completing cosmetic data until refresh. Roster event/mutation overlap still retains its own generation.
- Delayed cosmetic actions (openclaw#113062): the synthetic post-delay interleaving no longer needs generations; replacing an action does not revoke work that already started.
- Delayed gate lifetime (openclaw#113062): both real view owners cancel on disappearance, so a second weak-gate lifetime condition is redundant; a future caller omitting cancellation may still perform a harmless cosmetic completion after releasing its gate.
- Watch one-shot transport (openclaw#135808): cancelled instances cannot restart, so generations add no supported lifetime; cancellation and physical-resource checks remain.
- Command advertisements (openclaw#136192): the synthetic synchronous preference flip may briefly split a command family until reconnect; live invocation admission remains.
- Turn recaps (openclaw#112221/openclaw#113084): synthetic metadata-only mode and a duplicated pending terminal value are removed; the sole production caller always provides transcript facts, and same-timestamp metadata corrections now use the latest authoritative session row. History/terminal attribution, settlement bounds and all 21 retained tests remain.
- Realtime coordinator (openclaw#111033): direct concurrent reset/reuse is unsupported by serialized phone/Wear callers; current-session, duplicate-run, and live-submit guards remain.
- Network availability (openclaw#138732): an unexpected duplicate SDK AVAILABLE may wake offline retry early; the human battery fix (openclaw#127872), retry ladder, and current-session admission remain.
- iOS resource adapter (openclaw#148906): a captured invalidated loader may redundantly reload current metadata; the shared cache owner still cancels stale in-flight results and live authority remains checked.
- Watch startup buffer (5a652b8): synchronous MainActor registration cannot interleave with queued inbound delivery; a future caller yielding before registration may drop ephemeral requests, never ACK uncommitted chat.
- Mirror validation (openclaw#23636): the sole caller supplies normalized bounded fields; future internal callers must preserve that precondition.
- Beacon payload UTF-8 (openclaw#73330): Foundation JSONEncoder guarantees the bytes; a framework contract violation is an internal failure, not a recoverable conversion branch.
- Beacon envelope UTF-8 (openclaw#73330): the same guarantee removes the second conversion fallback; actual encoding errors still throw.
- Watch request UTF-8 (openclaw#135808): default encoder output cannot fail UTF-8 conversion; actual encoding errors still throw.
- Location event UTF-8 (openclaw#18260): default encoder output cannot fail UTF-8 conversion; nonfinite-value encoding failures keep their existing handling.
- HealthKit identifiers (openclaw#105616): fixed supported identifiers use nonfailable SDK constructors; authorization, privacy scope, and queries remain unchanged.
- Pre-iOS26 button fallback (openclaw#168595): the existing native deployment floor is26.2, so supported rendering is unchanged.
- Pre-Android26 priority fallback (openclaw#29398): the app minimum is31; notification-channel importance remains the active owner.
- WebView task document fences (openclaw#139514): existing MainActor cancellation-at-effect already rejects retired callbacks; navigation and document authority remain.

(cherry picked from commit 3dd5a00)

* refactor(ios): keep delayed cosmetic actions synchronous

Both production callers update toast or flash state synchronously on MainActor. Remove the unused async action contract and invoke it directly after the existing sleep/cancellation boundary. Keep asynchronous sleeping, cancellation, replacement and the returned task unchanged.

Best-effort tradeoffs accepted:
- None added by this type narrowing. The helper is internal, both callers and all retained tests already supply synchronous actions. The hypothetical suspending action discussed with openclaw#113062 is not a supported caller and is no longer expressible through this API.

Earlier guard-removal provenance and campaign proof are recorded in the preceding mobile cleanup commit. This follow-up changes no production LOC total, public protocol, permission, signing, dependency, persistence or visible rendering.

Validation: iPhone app/Share/embedded Watch build and61 focused tests in2 suites pass (DelayedActionGateTests and RootTabsPresentationTests),196.654s xcodebuild/0.628s tests. Configured SwiftFormat and strict SwiftLint pass; independent P0-P2 review is scoped-clean. Earlier unchanged-input changed-file, cycle and lint-suppression gates remain valid.
(cherry picked from commit c7c9fb6)

* fix(mattermost): keep inbound message content out of diagnostics

Log conversation, post ID and length instead of a body preview. Keep the
complete agent body and attachment order unchanged, and update the existing
monitor boundary test to reject content in diagnostics.

The regression fails before the repair on the leaked synthetic body prefix
after complete-body/ordered-media assertions pass, then passes after repair.
Final owner24, sibling25 and lint-suppressions3 tests pass; runtime and Madge
cycles are zero. Fresh production/test types, syntax lint, format and line-cap
checks pass, with no baseline, suppression or timeout increase.

This minimal privacy fix is explicitly authorized outside the old-code
eligibility restriction. The combined channel/native patch received a fresh
independent review with no actionable P0-P2 findings.

* fix(ios): remove retired Watch error from i18n inventory

* fix(mattermost): normalize nullable shutdown cleanup before await
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XL 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