Skip to content

fix(android): show chat model refresh failures - #140899

Merged
obviyus merged 3 commits into
mainfrom
codex/android-chat-metadata-error
Sep 7, 2026
Merged

obviyus merged 3 commits into
mainfrom
codex/android-chat-metadata-error

Conversation

@obviyus

@obviyus obviyus commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #136257.

What Problem This Solves

Android chat kept previous model choices after a failed refresh without showing a warning. Refresh chat updated history but did not retry model metadata.

Why This Change Was Made

The existing notice and model reader publish failures only for the current request, catalog, connection, and visible session. Refresh chat retries metadata and keeps the warning until an accepted success. Cancellation stays quiet and unrelated errors retain their owners.

User Impact

Users keep choices and unsent drafts during failure, see recovery guidance, and retry with the existing refresh action. Late failures from a previous chat do not appear in the current chat. No new API or storage is added.

Consumers: Android chat notices and Refresh chat now follow model-read outcomes.

Evidence

Six unit regressions and real emulator interaction reproduced silent failure. Candidate unit, build, lint, and formatting checks passed. Native checks verified retained choices/drafts, warning persistence during held refresh, clearing after success, rejection of old-session failure, and publication recovery with the picker open. An external relay injected failures after recording real Gateway replies; inference was not sent. Race and legacy cases use controller tests. Native checks used English; pending translations remain with the normal locale process.

@clawsweeper

clawsweeper Bot commented Sep 7, 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 7, 2026
@obviyus obviyus self-assigned this Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 2:09 AM ET / 06:09 UTC.

ClawSweeper review

What this changes

Android chat reports failed model refreshes while retaining previous choices, and the existing Refresh action retries the model read.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main still silently ignores model refresh failures. No concrete introduced defect was found, and the protected maintainer label rules out automated closure.

Priority: P2
Reviewed head: 3e3092ac39e86858a3d2df6ff124bb72e55aa1e0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant native observations and meaningful ordering regressions; no blocking code or security finding was identified.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The captured native evidence describes the real Android controller receiving injected Gateway failures, retaining model/draft, showing the notice, and clearing it after successful manual refresh. Narrower ordering cases have supplemental controller tests; linked screenshots could not be independently opened in this environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured native evidence describes the real Android controller receiving injected Gateway failures, retaining model/draft, showing the notice, and clearing it after successful manual refresh. Narrower ordering cases have supplemental controller tests; linked screenshots could not be independently opened in this environment.
Evidence reviewed 8 items Current main still needs the fix: The fetched main revision clears the error during Refresh without explicitly retrying metadata, and fetchChatMetadata catches failures without publishing a notice.
Failure and recovery ownership: The introduced code reuses the metadata reader, checks request sequence, connection scope, catalog scope, and visible selection before publishing failures, and clears only its own notice after accepted success. Cancellation is rethrown.
Existing visible recovery path: The chat header already invokes refreshChat, and the screen already renders controller errors through ChatNotice. The patch needs no additional UI, Gateway API, or dependency contract.
Findings None None.
Security None None.

How this fits together

Android chat reads model choices and commands from the Gateway. Its controller feeds the model picker and chat notice, while session and connection guards prevent stale responses from updating the current chat.

flowchart TD
  A[Refresh action or catalog event] --> B[Android chat controller]
  B --> C[Gateway metadata read]
  C --> D{Current request and chat?}
  D -->|No| E[Ignore stale notice update]
  D -->|Success| F[Update choices and clear refresh notice]
  D -->|Failure| G[Retain choices and show notice]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +304, Other +23. Total +327 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 304 0 +304
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 32 9 +23
Total 3 336 9 +327

Review metrics

None.

Technical review

Best possible solution:

Keep recovery in the existing chat controller and Refresh action, preserving accepted choices and unrelated errors until the current metadata read succeeds.

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

Yes, from source: fail a metadata refresh after loading choices; current main preserves the catalog but suppresses the failure, and Refresh does not explicitly retry that read. No runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes. Reusing the existing reader, notice, and selection guards is a narrow repair that avoids a competing model-loading path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a17f8c2b5d19.

Labels

Label changes:

  • add P2: This repairs misleading Android model-refresh feedback while preserving existing chat choices and a usable recovery action.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured native evidence describes the real Android controller receiving injected Gateway failures, retaining model/draft, showing the notice, and clearing it after successful manual refresh. Narrower ordering cases have supplemental controller tests; linked screenshots could not be independently opened in this environment.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This repairs misleading Android model-refresh feedback while preserving existing chat choices and a usable recovery action.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured native evidence describes the real Android controller receiving injected Gateway failures, retaining model/draft, showing the notice, and clearing it after successful manual refresh. Narrower ordering cases have supplemental controller tests; linked screenshots could not be independently opened in this environment.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: 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.

@obviyus
obviyus merged commit 84d07f4 into main Sep 7, 2026
125 checks passed
@obviyus
obviyus deleted the codex/android-chat-metadata-error branch September 7, 2026 06:24
@obviyus

obviyus commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Merged as 84d07f46d7b31fccc941b350df98189c98628e13.

  • Bug: a failed Android chat model refresh was silent, and Refresh chat did not retry the model read.
  • Fix: the existing reader owns the warning and recovery while preserving choices, drafts, and unrelated errors.
  • Proof: independent Android checks verified warning visibility, a pending manual refresh, stale-session rejection, and publication recovery. Controller tests cover the narrower ordering and cancellation cases.
  • Gates: required CI passed; exact-head local review passed at tier B with proof tier A and no findings.
Before After
Failed refresh kept old choices with no warning. The failure is visible and previous choices remain usable.
Refresh chat read history but did not retry models. It retries models and clears its warning after accepted success.

The landed patch matches the reviewed change. Before/after captures are in the PR body. Native proof used synthetic data and injected read failures, not provider inference.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
Report failed Android chat model refreshes through the existing notice while retaining accepted choices.

Keep warning writes and clears with the current read and visible session. Retry metadata through Refresh chat, preserve unrelated errors, and keep caller cancellation quiet.

Verified with regression tests and independent Android UI checks for visible failure, pending refresh, stale-session rejection, and publication recovery.

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 size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant