openclaw/apps/android/wear-shared
Ayaan Zaidi b761986967
fix(wear): use the selected session's model catalog (#144717)
Related: #136257 (F25), #142165.

## What Problem This Solves

Fixes an issue where the Watch model picker used the phone's current catalog instead of the session selected on the Watch. A valid Watch-session choice could be rejected before reaching the session owner. The Gateway also implemented session-scoped catalogs without advertising that capability in hello.

## Why This Change Was Made

The Wear bridge reads `models.list` for the requested session and uses the phone's existing result parser. The old phone-current catalog callback and selection veto are removed. Availability, unknown availability, search bounds, and partial-refresh warnings now flow from the same catalog result. Hello advertises the implemented capability, and the phone advertises model controls only when the Gateway supports it.

New Watches always send their selected session. Shipped protocol-v1 Watches that omit the field retain phone-active-session behavior through the same direct catalog owner. The protocol version is unchanged.

## User Impact

- The Watch lists models for its selected session and lets the session owner accept or reject a change.
- Partial refresh warnings preserve usable choices. Context changes clear old catalog and search state.
- Unsupported peers keep ordinary session navigation usable. Older Watches retain their existing request contract.

## Evidence

- Baseline hello regression: one expected failure, 30 passing cases; the implemented session-catalog capability was absent.
- Baseline selection regression: the phone-current catalog veto rejected a valid Watch-session choice before calling its owner.
- Candidate: 43 Gateway tests and 150 focused Android tests passed, including shared parser, real phone runtime/WebSocket dispatch, Watch repository, state transitions, proxy identity, and protocol coverage.
- Wear APK assembly, Kotlin formatting, and native localization verification passed.
- All 15 sanitized config-corpus fixtures passed actual Gateway startup with external networking disabled, fake credentials, and external Tailscale exposure disabled for isolation.
- A real Gateway client connection, also exercised by an independent validator, observed protocol 4, the published capability, and the requested fixture catalog.
- Wear API 34 and phone API 36 emulators booted with KVM. The normal Wear APK installed and launched. No paired Data Layer or live Watch picker result is claimed.
- Pairing proof gap, explicitly accepted for this change: **requires companion app + Play services; unit-covered**. The images have Play services but lack the required companion app; its official installation requires Google sign-in. Shared-parser, bridge, availability, and negotiation behavior are covered by the focused tests.

No provider inference, real credentials, protocol bump, or storage migration was used.

### Unrelated CI failure

Run [34567709488](https://github.com/openclaw/openclaw/actions/runs/34567709488) completed with every Android job passing. `checks-node-changed-extensions-config-49` failed the existing memory temporal-ranking `FTS unavailable` case at line 156; `openclaw/ci-gate` reports that child failure.

CI merged this head into main `2575d0d635` (#144641). That main change replaced the schema write probe with a row-count check, so the test's injected view now reports available. The exact CI base reproduces the same failure with five neighboring cases passing:

```sh
OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs --config test/vitest/vitest.extension-memory.config.ts extensions/memory-core/src/memory/manager-temporal-ranking.test.ts
# exit 1 on 2575d0d635
```

The earlier base `ada8b5f650` passes all six cases. This PR changes no memory implementation, schema, dependency, or test-runner code. The verified unrelated failure is retained as a separate follow-up; no CI retry or test weakening was used.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-09-11 11:47:48 +05:30
..
src fix(wear): use the selected session's model catalog (#144717) 2026-09-11 11:47:48 +05:30
build.gradle.kts chore(android): refresh libraries and build tooling (#135563) 2026-09-01 16:10:05 -07:00