Skip to content

fix(android): publish catalog refresh outcomes for the selected agent - #142355

Merged
obviyus merged 4 commits into
mainfrom
fix/android-catalog-result-refresh
Sep 11, 2026
Merged

obviyus merged 4 commits into
mainfrom
fix/android-catalog-result-refresh

Conversation

@obviyus

@obviyus obviyus commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@obviyus obviyus self-assigned this Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: M maintainer Maintainer-authored PR labels Sep 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 8, 2026, 1:34 PM ET / 17:34 UTC (Revision 2).

ClawSweeper review

What this changes

Android 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
Reviewed head: 575c21f72a45fe6b62c3bf4d8871bfefb772479e

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 8 items Current main still needs the Android fix: At the fetched main revision, updateMainSessionKey clears catalog state without requesting replacement rows, and refreshProviderModelsFromGateway reads only models, ignoring refreshFailed.
Gateway result contract: Current main projects snapshot.refreshFailed into models.list results. The documented provider-config view remains shared authored inventory; compatible rows remain usable after failure, and successful empty results remain empty. This is an OpenClaw Gateway response contract, with no changed dependency-specific harness contract.
Merged related work does not supersede native adoption: GitHub confirms #142165 merged on September 8, 2026. Its supplied body explicitly excludes native client adoption, so it supplies the response contract rather than replacing this Android work.
Findings None None.
Security None None.

How this fits together

Android 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]
Loading

Before merge

  • Resolve merge risk (P1) - The changed Android warning, recovery, and agent-switch behavior has not yet been demonstrated in a running native app.
  • Complete next step (P2) - Complete the declared Android runtime validation and add native before/after evidence to the PR body. Screenshots or recordings are preferred for the visible warning; runtime logs or transcripts also count. Redact credentials, addresses, and other private details. Updating the body should trigger re-review; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Tests +219, Other +19. Total +238 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 250 31 +219
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 24 5 +19
Total 4 274 36 +238

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep catalog ownership in the Gateway and expose its rows and refresh outcome through Android’s existing guarded publication and retry UI.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This repairs bounded Android model-settings feedback and selected-agent catalog refresh behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Current main still needs the Android fix: At the fetched main revision, updateMainSessionKey clears catalog state without requesting replacement rows, and refreshProviderModelsFromGateway reads only models, ignoring refreshFailed. (apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:2468, 0140d656b101)
  • Gateway result contract: Current main projects snapshot.refreshFailed into models.list results. The documented provider-config view remains shared authored inventory; compatible rows remain usable after failure, and successful empty results remain empty. This is an OpenClaw Gateway response contract, with no changed dependency-specific harness contract. (src/gateway/server-methods/models-list-result.ts:417, 0140d656b101)
  • Merged related work does not supersede native adoption: GitHub confirms feat(models): read session catalogs directly in the Control UI #142165 merged on September 8, 2026. Its supplied body explicitly excludes native client adoption, so it supplies the response contract rather than replacing this Android work. (f0f5eade59d3)
  • Publication and visible warning path: The introduced hunks preserve unconditional publication of returned rows, including empty lists, and publish the localized warning through the existing error state. ProvidersModelsScreen renders that state alongside provider rows and retains its explicit Refresh action. Existing connection and generation fences remain in place. (apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:6637, 575c21f72a45)
  • Regression coverage and review continuity: The reviewed tests cover warning publication, authoritative empty results, recovery, automatic selected-agent reads, delayed obsolete replies, and same-agent preservation. GitHub's exact-head commit patch confirms the revision after the prior review changes only test formatting; the previous review had no code findings. (apps/android/app/src/test/java/ai/openclaw/app/NodeRuntimeAgentSelectionTest.kt:45, 575c21f72a45)
  • Native proof remains pending: The complete supplied body, rechecked unchanged through GitHub, reports passing phone unit jobs on the preceding revision and explicitly says APK/device proof remains pending. Run 34254427291 confirms both phone unit jobs passed and Android formatting failed on that preceding revision. No native after-fix capture or runtime transcript was supplied; tests were not executed during this read-only review. (3c5cb0e93a97)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-08T17:04:17.746Z sha 3c5cb0e :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 8, 2026
@obviyus
obviyus force-pushed the fix/android-catalog-result-refresh branch from 575c21f to 286e0e6 Compare September 11, 2026 04:46
@obviyus
obviyus merged commit 2e47020 into main Sep 11, 2026
126 of 128 checks passed
@obviyus
obviyus deleted the fix/android-catalog-result-refresh branch September 11, 2026 05:04
@obviyus

obviyus commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

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.

  • Bug: Android ignored failed catalog outcomes and did not start replacement reads when the selected agent changed.
  • Fix: The existing runtime publishes returned rows and refresh outcomes through its connection/request guards and starts passive reads after agent selection.
Before After
Failed refresh returned rows without a warning Returned rows and a retry warning appear together
Agent changes cleared catalog rows without loading replacements The selected agent's catalog and readiness load automatically

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.

obviyus added a commit that referenced this pull request Sep 11, 2026
…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]>
threely-lab pushed a commit to threely-lab/openclaw that referenced this pull request Sep 11, 2026
…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
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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