Repository navigation
fix(android): publish catalog refresh outcomes for the selected agent - #142355
Conversation
|
🦞👀 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: blocked before merge. Reviewed September 8, 2026, 1:34 PM ET / 17:34 UTC (Revision 2). ClawSweeper reviewWhat this changesAndroid now shows catalog refresh warnings alongside returned models and reloads model choices when the selected agent changes. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful Android fix: current main lacks both behaviors, and the merged Gateway work explicitly excluded native adoption. No actionable patch defect was found; the declared native UI validation remains outstanding. Priority: P2 Review scores
Verification
How this fits togetherAndroid reads model choices and provider readiness from the connected Gateway. NodeRuntime publishes those results to the model picker and Providers & Models settings, while connection and request generations reject obsolete responses. flowchart TD
A[Selected agent changes] --> B[Retire previous catalog results]
B --> C[Read Gateway catalog and readiness]
D[User taps Refresh] --> C
C --> E{Connection and request still current?}
E -->|Yes| F[Publish returned rows and refresh warning]
E -->|No| G[Discard obsolete response]
F --> H[Android model picker and settings]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +219, Other +19. Total +238 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep catalog ownership in the Gateway and expose its rows and refresh outcome through Android’s existing guarded publication and retry UI. Do we have a high-confidence way to reproduce the issue? Yes, from current source: a successful models.list response carrying refreshFailed is ignored, and an agent transition clears rows without initiating replacement reads. This review did not execute the app. Is this the best way to solve the issue? Yes. The patch consumes the existing Gateway outcome and starts passive reads at the existing agent-transition owner without adding a competing cache or changing configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0140d656b101. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
575c21f to
286e0e6
Compare
|
Landed as 2e47020. Proof: Matched base/candidate Play unit runs passed. The final focused run passed 106 tests. In the normal Android app on an API 36 emulator, Beta's failed refresh showed the returned model and retry warning; a successful retry replaced the row and cleared the warning on the same screen. Independent native validation repeated the cycle and verified the installed APK. Catalog responses used a deterministic fixture with fake credentials.
The exact-head CI gate passed, and the local review found no blocking issue. No unrelated-red exception was needed; the matched base Play selection was also green. |
…144711) Related: #136257 Related: #142355 ## What Problem This Solves Fixes an issue where Android users could enable Fast or choose thinking levels that their selected model did not support. The chat picker also lacked the Gateway's native provider sign-in methods and session-specific model details. ## Why This Change Was Made Android now reads the prepared session catalog and uses its published Fast, thinking, input, availability, and route facts. The picker uses the native auth owner for credential state and available sign-in methods, including browser/device steps and supported API-key setup. Native credential writes retain the Gateway's existing auth refresh behavior. The catalog parser is shared with the selected-agent refresh path landed in #142355. Provider-name Fast inference, hard-coded thinking choices, and the guessed empty-catalog retry are removed. No protocol version, schema, or generated Swift changes are needed. ## User Impact - Model and effort choices follow the selected session's published capabilities. - Saved overrides remain clearable, and saved thinking values survive partial replies without leaking the previous model's choices. - Sign-in is available from the picker and auth recovery. Methods and credential state come from the Gateway. - Older Gateways retain slash commands and show update guidance for session model choices. ## Evidence - Baseline regressions reproduced provider-name Fast inference and the obsolete chat metadata catalog. - All 144 focused Android unit and Robolectric tests pass, covering catalog projection, picker behavior, session selection, command controls, auth lifecycle, and adjacent UI/outbox behavior. - Another 151 targeted tests pass after completing the remaining current-Gateway fixtures and lazy-list interactions. All existing behavior assertions are retained. - Android debug assembly and Kotlin lint pass. Native string verification, native state version guard, protocol event coverage, and the protocol schema sibling test pass. - Config-corpus tests pass (11 tests). All ten sanitized fixtures pass real Gateway startup on the integrated candidate with fake credentials and external networking disabled. - Kotlin protocol regeneration produces no diff; no Swift output changes. - Emulator acceptance exposed a missing Gateway hello capability. The session catalog was already implemented and documented, but its capability was not advertised. The existing handshake test reproduces the omission; the one-line advertisement fix and neighboring handshake tests pass. - Android 16 emulator against one real Gateway: Priority Chat shows the five published thinking choices and Fast; Standard Chat (the same provider) offers no thinking choices, and its saved unsupported Fast override can be cleared. CLI inventory agrees on models and inputs; detailed session catalog output supplies Fast/thinking facts that the CLI inventory does not print. - Native xAI API-key setup with a synthetic key acknowledges the save, clears the form, and reads back the Gateway's configured credential state. This proves the native setup flow, not real-provider authentication or inference. Browser/device progression and cancellation have focused protocol unit coverage. - Earlier-Gateway compatibility: Android’s documented `/model <model> -s` command changes the session model. After upgrading the same Gateway state, native choices return and the selected model/default/override state remain intact. Co-authored-by: Ayaan Zaidi <[email protected]>
…outcomes) Cherry-picked upstream openclaw#142355 which depends on the new parseGatewayModelCatalog introduced by openclaw#144711. Refreshes the selected agent's catalog when the chosen agent changes (and the operator is connected), and surfaces a refresh-failed warning when the Gateway cannot supply a usable catalog result. - NodeRuntime.kt: cherry-pick applied with one conflict at the GatewayModelSummary region — resolved by keeping HEAD's side (empty), since the data class / enum / parseGatewayModels now live in GatewayModelCatalog.kt (openclaw#144711). The catalog-refresh and refreshProviderModels methods use parseGatewayModelCatalog and surface an error string when refreshFailed is true. - apps/.i18n/native-source.json: +1 entry ("Some models could not be refreshed. Tap Refresh to retry.") — translations live in upstream's refresh-native-locales pipeline; will be picked up on the next periodic bot refresh. - Test files dropped (fork does not compile app/src/test). - version 2026.9.11.7 / 2026091107
…openclaw#142355) Publish the Gateway's returned model rows and refresh warning in Android settings. Start passive catalog reads when the selected agent changes, while retaining connection and request fences. Validated with matched base/candidate Play unit runs, 106 focused tests, and an Android emulator showing selected-agent refresh failure and successful recovery. Co-authored-by: Ayaan Zaidi <[email protected]>
…penclaw#144711) Related: openclaw#136257 Related: openclaw#142355 ## What Problem This Solves Fixes an issue where Android users could enable Fast or choose thinking levels that their selected model did not support. The chat picker also lacked the Gateway's native provider sign-in methods and session-specific model details. ## Why This Change Was Made Android now reads the prepared session catalog and uses its published Fast, thinking, input, availability, and route facts. The picker uses the native auth owner for credential state and available sign-in methods, including browser/device steps and supported API-key setup. Native credential writes retain the Gateway's existing auth refresh behavior. The catalog parser is shared with the selected-agent refresh path landed in openclaw#142355. Provider-name Fast inference, hard-coded thinking choices, and the guessed empty-catalog retry are removed. No protocol version, schema, or generated Swift changes are needed. ## User Impact - Model and effort choices follow the selected session's published capabilities. - Saved overrides remain clearable, and saved thinking values survive partial replies without leaking the previous model's choices. - Sign-in is available from the picker and auth recovery. Methods and credential state come from the Gateway. - Older Gateways retain slash commands and show update guidance for session model choices. ## Evidence - Baseline regressions reproduced provider-name Fast inference and the obsolete chat metadata catalog. - All 144 focused Android unit and Robolectric tests pass, covering catalog projection, picker behavior, session selection, command controls, auth lifecycle, and adjacent UI/outbox behavior. - Another 151 targeted tests pass after completing the remaining current-Gateway fixtures and lazy-list interactions. All existing behavior assertions are retained. - Android debug assembly and Kotlin lint pass. Native string verification, native state version guard, protocol event coverage, and the protocol schema sibling test pass. - Config-corpus tests pass (11 tests). All ten sanitized fixtures pass real Gateway startup on the integrated candidate with fake credentials and external networking disabled. - Kotlin protocol regeneration produces no diff; no Swift output changes. - Emulator acceptance exposed a missing Gateway hello capability. The session catalog was already implemented and documented, but its capability was not advertised. The existing handshake test reproduces the omission; the one-line advertisement fix and neighboring handshake tests pass. - Android 16 emulator against one real Gateway: Priority Chat shows the five published thinking choices and Fast; Standard Chat (the same provider) offers no thinking choices, and its saved unsupported Fast override can be cleared. CLI inventory agrees on models and inputs; detailed session catalog output supplies Fast/thinking facts that the CLI inventory does not print. - Native xAI API-key setup with a synthetic key acknowledges the save, clears the form, and reads back the Gateway's configured credential state. This proves the native setup flow, not real-provider authentication or inference. Browser/device progression and cancellation have focused protocol unit coverage. - Earlier-Gateway compatibility: Android’s documented `/model <model> -s` command changes the session model. After upgrading the same Gateway state, native choices return and the selected model/default/override state remain intact. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Android Providers & Models hid refresh warnings when a successful response contained refreshFailed. Switching agents also cleared the catalog without requesting replacement results.
Why This Change Was Made
The Android runtime publishes returned rows and refresh outcomes through its existing request guards. Selecting an agent retires old requests and starts passive catalog and readiness reads. Catalog composition stays with the Gateway.
User Impact
Failed refreshes show a warning and keep Refresh available. Successful results replace rows and clear warnings, including empty results. Agent changes load the selected agent's catalog; obsolete responses cannot restore old rows.
Consumers: Android Providers & Models now displays refresh outcomes and reloads results on agent changes.
Evidence
Seven regression tests failed against the original runtime. The candidate passed the full Android unit selection and 106 focused tests with no skips. A real emulator paired normally, selected another agent, and showed retained rows with a failed-refresh warning, then refreshed rows without the warning after retry. Screenshots and requests confirmed both actions targeted the selected agent. Formatting, localization, and lint checks passed. Catalog responses were synthetic; inference was not tested.