Skip to content

refactor(android): derive connection readiness from its owner - #202898

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/android-connection-state-owner-20261121
Nov 26, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/android-connection-state-owner-20261121

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Related: #202818

What Problem This Solves

NodeRuntime stores connection readiness twice: in GatewayConnectionDisplay and in a separate mutable Boolean flow. Every status update must keep both synchronized, while runtime decisions already use the display.

User Impact

No intended behavior change. The ViewModel keeps its Boolean StateFlow API, false initial value, runtime switching and subscription lifecycle. Connection, retry, permission and authentication policies are unchanged.

Why This Change Was Made

Remove the duplicate runtime Boolean and its write. Derive the existing ViewModel stream from the authoritative display through its existing runtime adapter, and migrate the debug voice harness's two direct reads. Update five UI fixtures to seed the same state the application uses.

Evidence

  • Replacement head 27cab4d5cb7bec09da6292a410df8d08fda6761b is based on ef7867a9a7c8ae0c5d3b68547eda4672773563a7. It preserves the landed direct-state diary test and migrates the newer session-browser test's read to the connection display.
  • Both phone flavors compiled; Kotlin lint and staged-content/freshness checks passed against the replacement's exact Android source tree in the retained frozen tooling environment, with unchanged Android build inputs.
  • Nine affected suites ran per flavor. Play passed all 96 tests; third-party passed 95 of 96, with a 5-second timeout waiting for the first archive row in SessionBrowserRefreshTest. The exact parent and replacement each passed that test in isolation. This remains an unexplained combined-run timing failure; the isolated passes do not prove a fix or establish that the failure is inherited. Original XML and the comparison results are retained.
  • Fresh independent source review found no remaining direct or reflected consumers of the retired field across Android source sets. Both old and new ViewModel paths end in the same conflating StateFlow; no extra connection emissions or production regression were established. Local ClawSweeper reviewed the full replacement range and found no actionable correctness or security defects.
  • The existing ViewModel contract checks initial state, updates, replacement-runtime selection and suppression of old-runtime emissions. No production test seam was added. No assertion or timeout was weakened.

The original head separately passed 87 tests per flavor and PR CI. That prior-head evidence does not qualify this replacement. Current-head CI remains required. Local tests use isolated runtime/UI fixtures; no live Gateway connection or voice session is claimed.

Current CI status

Current-head CI run 45796611803 completed the full third-party unit tests successfully. Its following Android lint invocation failed while resolving the pinned tool dependencies after Maven Central returned HTTP 429; no lint verdict was produced. This setup failure is separate from the retained local UI timeout above. The complete run and required gates remain pending qualification.

The failed-job-only second attempt completed successfully at the unchanged head. The retry followed successful Android app lint in run 45796907702, after the failure, with all nine relevant build, repository, workflow and toolchain inputs identical. Original failure evidence remains retained.

Current-head CI attempt 2 passed. The original infrastructure failure and unresolved local timing observation remain recorded above; a passing replay is not presented as a fix for that local observation.

@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 03:13
@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

This PR derives Android connection readiness from GatewayConnectionDisplay and removes the duplicate runtime Boolean.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct ownership cutover supported by in-process tests; it is one slice of the linked maintenance tracker and remaining exact-head Android checks are pending.
Proof confidence 🦐 gold shrimp (3/6) This behavior-preserving refactor needs no shipped-entry-point demonstration; supplied Robolectric and UI-fixture validation covers readiness updates and runtime replacement without claiming live Gateway or voice proof.
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 demonstrated duplicate state; this PR completes its narrow slice and correctly uses Related for the broader tracker.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a focused, maintainer-authored ownership cleanup with no actionable correctness or security findings; remaining Android CI is pending.

Priority: P3
Reviewed head: 1ec2296f4f227b33d0d0f0969b9c9c4f491f6cd0

Before merge

None.

Findings

None.

Agent review details

How this fits together

NodeRuntime combines operator and node connection status into GatewayConnectionDisplay; MainViewModel exposes that state to Android screens, while the debug voice service reads runtime readiness directly.

flowchart LR
  A[Operator connection] --> C[NodeRuntime status owner]
  B[Node connection] --> C
  C --> D[GatewayConnectionDisplay]
  D --> E[MainViewModel flow adapter]
  E --> F[Android screens]
  D --> G[Debug voice service]
Loading

Technical review

Best possible solution:

Keep GatewayConnectionDisplay authoritative and retain the existing ViewModel Boolean projection without a separate mutable runtime mirror.

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

Source confirms duplicate readiness storage on current main; this refactor reports no runtime defect, and no target code or tests were executed during review.

Is this the best way to solve the issue?

The change uses the existing owner and adapter, preserves false initialization and eager subscription, and migrates the removed field's consumers without adding production machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 64e412e adds apps/android/app/src/main/java/ai/openclaw/app/MainViewModel.kt:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 64e412e57e72; files: apps/android/app/src/main/java/ai/openclaw/app/MainViewModel.kt)
  • Masato Hoshino: Raw commit 40d4e32 adds apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:813 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 40d4e321105a; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt)
  • Peter Steinberger: Raw commit 025d572 adds apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:2562 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 025d572de58f; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt)

PR surface

Source -2, Tests +49. Total +47 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 6 8 -2
Tests 6 57 8 +49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 63 16 +47

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 behavior and addresses no reported user-facing failure.
  • 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.

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, 10:28 PM ET / November 21, 2026, 03:28 UTC.

@vincentkoc
vincentkoc force-pushed the refactor/android-connection-state-owner-20261121 branch from 1ec2296 to 27cab4d Compare November 26, 2026 09:56
@vincentkoc
vincentkoc merged commit a4eddbe into main Nov 26, 2026
147 of 149 checks passed
@vincentkoc
vincentkoc deleted the refactor/android-connection-state-owner-20261121 branch November 26, 2026 10:39
@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. 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