Repository navigation
refactor(apps): simplify native lifecycle and read paths - #169336
Conversation
Remove speculative snapshot and lifecycle coordination, preserve security and durable write boundaries, and consolidate Apple media loading. Accept best-effort presentation, pagination, and cleanup races documented in the lane review.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR simplifies native startup, Talk, pagination, sidebar gestures, and sleep coordination while sharing Apple media decoding. Example: Android loads 201 cron jobs while the snapshot revision changes between offsets 0 and 200.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this PR open. The maintainer-directed simplification has clear maintenance value, and inspection found no actionable introduced defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe native clients translate user interactions and operating-system lifecycle events into Gateway requests, then present returned sessions, media, configuration, and readiness state. flowchart LR
A[User and operating system] --> B[Native lifecycle owners]
B --> C[Platform authorization and transport]
C --> D[Gateway]
D --> E[Shared decoding and read models]
E --> F[Native presentation]
Technical reviewBest possible solution: Retain the simpler native owners, documented best-effort tradeoffs, and existing authorization and durable-write boundaries. Do we have a high-confidence way to reproduce the issue? This is an intentional refactor rather than a defect report; source inspection confirms the changed behaviors, and no target code was executed. Is this the best way to solve the issue? The approach follows repository guidance by replacing speculative coordination with documented best-effort behavior and consolidating decoding without merging platform transport responsibilities. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ca3798a38171. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -711, Tests -608. Total -1319 across 32 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 5:15 PM ET / 21:15 UTC (Revision 2). |
Use the existing runtime dependency injection in the bootstrap-failure fixture so config validation does not initialize live audio players during cleanup. Preserve all behavior assertions.
…9336) * refactor(apps): simplify native lifecycle and read paths Remove speculative snapshot and lifecycle coordination, preserve security and durable write boundaries, and consolidate Apple media loading. Accept best-effort presentation, pagination, and cleanup races documented in the lane review. * test(macos): isolate Talk config cleanup from audio services Use the existing runtime dependency injection in the bootstrap-failure fixture so config validation does not initialize live audio players during cleanup. Preserve all behavior assertions.
What Problem This Solves
Simplifies native app lifecycle and read paths that carried duplicate state, synthetic-race guards, or parallel implementations after several recent native cleanup passes.
User Impact
Normal connection, Talk, media, sidebar, and sleep/wake flows remain supported. Listings, copied transcripts, and presentation-only settings now explicitly use best-effort behavior during concurrent changes. Security checks, transcript flushing, bounded resource protections, and ordinary reconnect behavior remain in place. No schema, dependency, protocol, or persisted-data changes.
Why This Change Was Made
The native clients had more coordination machinery than these read/presentation paths need. This removes redundant generation state and snapshot protocols, uses Compose's maintained drag detector, and gives iOS/macOS media-result handling one shared owner while retaining their separate authorization/TLS adapters.
Net production reduction: 502 release-code lines, excluding test files, embedded Rust test modules, and Swift DEBUG-only test support. File-based production accounting is 537 lines before removing those 35 debug-support lines. This is the campaign's 500–999-line closeout after a recent-additions and largest-owner audit; the coverage ledger is below. Test-only deletion is not counted as production reduction.
Best-effort tradeoffs accepted
Evidence
check-changedcompleted with eight unrelated 20-second verifier subprocess timeouts inmac-elevation-artifact.test.ts; 122 tests in its first macOS group and 490 tests in its second group passed. The installer, test, fixtures, and helpers are byte-identical to currentmain. All eight failed cases passed unchanged in two focused runs with the original timeout/concurrency. This is evidence of contention-sensitive fixtures, not a claimed fix or a hosted main-red exception. The remaining macOS tooling group passed all eight shards separately. Exact-head hosted CI remains the landing gate.The production commit
e8542cf259ebc5a4fac5cfa15be2329a32aac45bpassed CI run https://github.com/openclaw/openclaw/actions/runs/38171772163. Follow-upd8f289ae1684fbe0608a28d86318022f1436bae3only isolates the existing Talk test's audio cleanup; its fresh independent review and sandbox runtime test passed. Its exact-head CI also passed: https://github.com/openclaw/openclaw/actions/runs/38175075478. All 59 active checks completed successfully, including the separate Apple scans.Merged as
0e998aa0985cc1da088a05a7afe4f12d31faf0f2. Post-merge fetch verified ancestry onorigin/mainand identical contents to the reviewed head for all changed files. No admin CI exception, CI rerun, or rebase was used.Coverage ledger
Follow-up requiring separate dependency/CI approval: Android's dormant Cloudflare Access foundation (~878 production lines, #147061/#147305) has no active app caller. It is untouched here; removing only part would leave an incomplete cutover.