Skip to content

refactor(apps): reuse Watch approval transport models#105024

Merged
steipete merged 2 commits into
mainfrom
codex/approval-clients-refactor
Jul 12, 2026
Merged

refactor(apps): reuse Watch approval transport models#105024
steipete merged 2 commits into
mainfrom
codex/approval-clients-refactor

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #103912

What Problem This Solves

The native approval client feature is valuable, but the Watch target carried local copies of transport enums, commands, approval items, identifiers, and leaf DTOs that already existed in OpenClawKit. That duplication made the approval stack larger and allowed equivalent phone/Watch protocol models to drift.

Why This Change Was Made

This refactor makes OpenClawKit the canonical owner for reusable Watch transport leaf models while retaining local Watch envelope structs where their Codable shape is part of the existing persisted inbox state. It also compiles the phone's exact opaque-identifier implementation into the Watch target, moves notification-component framing onto that shared byte-exact key, and gives the canonical Watch action model the Identifiable conformance required by SwiftUI.

The focused test cleanup removes source guards that reimplemented generic Set and UTF-8 behavior, while keeping guards for transport ordering, canonical readback, compound ownership, accessibility, notification framing, and snapshot acceptance.

User Impact

No feature or behavior change. Android, iPhone, and Apple Watch approval review retain the same decisions, exact identifiers, persistence envelopes, WatchConnectivity payloads, retry/readback behavior, notification identity, and UI. The maintained diff is 219 net lines smaller, including 153 fewer production lines.

Evidence

  • git diff --check
  • SwiftFormat 0.62.1 lint on all changed Swift files: clean
  • swiftc -parse on all changed Swift sources/tests: clean
  • XcodeGen 2.45.4 generation from apps/ios/project.yml: clean
  • Blacksmith Testbox through Crabbox tbx_01kxac3r9grcjsypes0vr72czx: pnpm check:changed passed with app-surface guards and 5 routed Vitest shards (174 passed, 37 skipped)
  • Final structured autoreview (gpt-5.6-sol, xhigh): no accepted/actionable findings
  • Net diff: 74 additions, 293 deletions across 5 files

Remaining platform gate: macOS CI owns SwiftLint and the authoritative iPhone/Watch compile because the delegated Testbox is Linux.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: M maintainer Maintainer-authored PR labels Jul 12, 2026
@steipete steipete self-assigned this Jul 12, 2026
@steipete
steipete marked this pull request as ready for review July 12, 2026 05:50
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(apps): reuse Watch approval transport models This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 2:04 AM ET / 06:04 UTC.

Summary
Reuses OpenClawKit Watch transport models and exact identifier logic in the watchOS target while retaining local persisted inbox envelopes and focused source guards.

PR surface: Other -219. Total -219 across 5 files.

Reproducibility: not applicable. This PR is a behavior-preserving ownership refactor rather than a bug report, and source inspection plus the exact-head iOS build provide the relevant verification.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The macos-swift check was still in progress at review time; merge should continue to rely on the exact-head required-check gate.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the PR’s canonical OpenClawKit leaf-model ownership, explicit WatchConnectivity framing, and local persisted-envelope ownership, then merge after the remaining exact-head Apple checks complete.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No repair is needed; the protected maintainer-owned PR should remain in the normal exact-head check and maintainer merge path.

Security
Cleared: The patch adds no new dependency source, executable hook, permission, secret access, authorization behavior, or supply-chain surface.

Review details

Best possible solution:

Keep the PR’s canonical OpenClawKit leaf-model ownership, explicit WatchConnectivity framing, and local persisted-envelope ownership, then merge after the remaining exact-head Apple checks complete.

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

Not applicable; this PR is a behavior-preserving ownership refactor rather than a bug report, and source inspection plus the exact-head iOS build provide the relevant verification.

Is this the best way to solve the issue?

Yes. Reusing the existing watchOS-capable OpenClawKit models removes duplicate protocol ownership without adding a parallel API, while retaining local envelope structs protects the established persisted inbox shape.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P3: This is a focused, behavior-preserving internal cleanup with limited blast radius and no identified user-facing regression.
  • 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 repository's proof gate confirms the author is an active OpenClaw maintainer-team member, so the external-contributor real-behavior proof requirement does not apply to this PR.

Label justifications:

  • P3: This is a focused, behavior-preserving internal cleanup with limited blast radius and no identified user-facing regression.
  • 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 repository's proof gate confirms the author is an active OpenClaw maintainer-team member, so the external-contributor real-behavior proof requirement does not apply to this PR.
Evidence reviewed

PR surface:

Other -219. Total -219 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 74 293 -219
Total 5 74 293 -219

What I checked:

Likely related people:

  • steipete: Peter Steinberger introduced the current native approval Watch transport, shared model, exact identifier, codec, and project-target surfaces and is the strongest routing candidate for this follow-up consolidation. (role: feature owner and recent area contributor; confidence: high; commits: 4b82e1af19d9, 175b049a886c; files: apps/ios/WatchApp/Sources/WatchInboxMessages.swift, apps/ios/WatchApp/Sources/WatchConnectivityReceiver.swift, apps/ios/Sources/Services/WatchMessagingPayloadCodec.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 12, 2026
@steipete
steipete merged commit 2a02ab6 into main Jul 12, 2026
67 of 72 checks passed
@steipete
steipete deleted the codex/approval-clients-refactor branch July 12, 2026 06:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
* refactor(apps): reuse watch approval transport models

* fix(ios): satisfy exact identifier lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios 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: M 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