Skip to content

fix(ios): disclose model targets and enforce availability - #135044

Merged
fuller-stack-dev merged 11 commits into
mainfrom
fix/ios-model-picker-scope-availability
Sep 1, 2026
Merged

fuller-stack-dev merged 11 commits into
mainfrom
fix/ios-model-picker-scope-availability

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #134306

Related: #127813, #131697, #132179

What Problem This Solves

Fixes an issue where iOS users choosing a model could not tell whether the selection would change only the current session, the agent default, or the global default. It also fixes the native availability gap: models the Gateway marked unavailable still appeared selectable in both iOS pickers, and a selected model with a permanent authentication failure did not block a live send.

Why This Change Was Made

PR #127813 deliberately made an omitted selection scope resolve through Gateway policy. This change keeps that behavior and presents the Gateway-resolved target before selection instead of duplicating the policy in Swift.

The same shared iOS model projection now preserves Gateway availability for both picker surfaces and composer admission. New Gateways provide session-scoped chat.metadata; capability negotiation keeps availability non-authoritative on older Gateways. Metadata events, current-session mutations, reconnects, route changes, and sequence gaps refresh the accepted catalog with current-session and latest-request fencing.

This brings iOS in line with the contract established by #131697. The omission recorded in #132179 was safe while iOS did not enforce availability; it is no longer safe once native sends are gated. Only missing-auth and auth-failed block an online live send. Cooldown, unknown or absent availability, a usable provider alias, and offline durable queueing remain admitted.

Android is unchanged and is not claimed as fixed here.

User Impact

iOS users see the model write target before choosing a model. Unavailable models remain visible with a reason but cannot be selected in either picker. If the selected model has a permanent authentication problem, the composer explains what needs attention; a successful credential refresh clears the gate without an app restart or session change.

Evidence

The media use a deterministic local fixture and contain no credentials or private user data. The simulator proof ran at 6793ab7ddfe640ec1ce361fe5cce80617112add7; all 22 task-owned files are byte-identical at final head 6b16d6f192669764041b8a36e72ac42de14080e2. The final apps tree also contains an unrelated invoke-timeout refactor merged from main; the surface-impact audit found no change to the picker, projection, composer, catalog, session, or Gateway metadata paths. The manifest records both tree identities, the final continuous H.264 recording, contact sheet, and transcode checksums. Browser file permissions prevented attaching the final MP4, so the linked recording is labeled with its exact SHA. Proof media are not committed.

Compatibility and Scope

  • No configuration, persistence schema, or protocol-version change.
  • Existing Gateway write semantics are unchanged; the disclosed target comes from the same Gateway result that owns the write decision.
  • Legacy Gateways continue to provide model lists, but iOS does not treat their agent-wide availability as session-authoritative.
  • Production delta: +329/-28 lines; test and fixture support: +702/-8 lines; generated localization inventory: +9/-1 lines; protocol coverage allowlist: -1 line. The production growth adds the missing capability boundary, lossless projection, lifecycle fencing, two shared presentations, and admission contract rather than a parallel policy implementation.

Release Note Context

iOS: show whether a model choice affects the session, agent, or global default; disable Gateway-unavailable models and explain permanent authentication failures before sending.

No changelog file was edited; release-owned changelog handling remains unchanged.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios scripts Repository scripts size: L maintainer Maintainer-authored PR labels Sep 1, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the fix/ios-model-picker-scope-availability branch from ffe54c5 to 20b1a97 Compare September 1, 2026 09:30
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 1, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 1:51 PM ET / 17:51 UTC.

ClawSweeper review

What this changes

The PR makes iOS model pickers disclose the Gateway-resolved write target, disables unavailable model choices, and prevents online sends only for selected models with permanent authentication failures.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open: current main does not contain its iOS model-catalog changes, and the previously reported refresh race is addressed at the current head. It is MEMBER-authored and carries the protected maintainer label, so final landing remains a maintainer decision after exact-head checks resolve.

Priority: P1
Reviewed head: fdac6d5056ce68838e61b7d3277b348bc674e2a8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused owner-boundary and ordering coverage, with the remaining limitation being unresolved exact-head check status rather than a demonstrated code defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable as a real-behavior merge gate because this is a MEMBER-authored PR and no authority-chain trigger is present; the supplied deterministic iOS fixture recordings are supporting evidence for the visible picker and composer states.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable as a real-behavior merge gate because this is a MEMBER-authored PR and no authority-chain trigger is present; the supplied deterministic iOS fixture recordings are supporting evidence for the visible picker and composer states.
Evidence reviewed 6 items Catalog owner and send gate: The introduced catalog owner uses the transport's session-scoped snapshot, fences stale requests by session and request ID, and blocks only permanent auth reasons before a live send.
Gateway contract exists on current main: The Gateway accepts an authorized optional session selector for chat metadata, while the protocol schema documents that it preserves the persisted auth-profile selection.
Refresh-race regression coverage: Focused shared-chat tests cover metadata events superseding a held sequence-gap refresh, current-session patch and command-metadata refreshes, stale responses, and failed newest refreshes.
Findings None None.
Security None None.

How this fits together

The iOS chat client obtains model and session facts from the Gateway, renders them in the inline and Chat Actions pickers, then uses the selected model when sending a chat turn. This change propagates session-scoped availability and write-target facts through that client path.

flowchart LR
A[Gateway session metadata] --> B[iOS chat transport]
B --> C[Session model catalog]
C --> D[Inline model picker]
C --> E[Chat Actions picker]
C --> F[Composer send gate]
D --> G[Gateway model update]
F --> H[Live chat send]
Loading

Before merge

  • Resolve merge risk (P1) - The new iOS send gate depends on a fresh, session-correct Gateway catalog; stale availability could wrongly prevent a live send. The branch has targeted ordering coverage, but exact-head check status is still unresolved.
  • Resolve merge risk (P1) - This bug-fix branch adds net 301 production lines across shared model and authentication state, increasing the review surface even though the capability boundary and tests explain the growth.
  • Complete next step (P2) - This MEMBER-authored, maintainer-labeled PR needs exact-head check resolution and maintainer landing review rather than an automated repair job.
Agent review details

Security

None.

PR surface

Other +1002. Total +1002 across 22 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 22 1040 38 +1002
Total 22 1040 38 +1002

Review metrics

Metric Value Why it matters
Production versus test delta production +329/-28; tests/support +702/-8; generated inventory +9/-1; coverage allowlist -1 Most growth implements the shared session-catalog and availability boundary; the substantial production addition warrants focused maintainer review.

Stored data model

Persistent data-model change detected: vector/embedding metadata: apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatGatewayPayloadCodec.swift, vector/embedding metadata: apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayPush.swift, vector/embedding metadata: scripts/protocol-event-coverage.allowlist.json. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #134306
Summary: This PR is the candidate implementation for the model write-target disclosure requested by the linked issue, while also completing iOS consumption of the existing availability contract.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Complete exact-head validation (recommended)
    Resolve the failed Node compact check and let the in-progress iOS screenshot-evidence check reach a terminal result before landing the new auth-gated send path.
  2. Pause the change
    Pause if the remaining exact-head checks cannot establish that the session-scoped catalog remains safe across the supported iOS transport path.

Technical review

Best possible solution:

Retain the negotiated session-scoped catalog path, then land only after exact-head checks confirm the guarded iOS behavior and maintainers accept the shared-client scope.

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

Yes, from source: the merge-base did not preserve model availability into the iOS picker or test it before live send; the current branch adds both gates and targeted regressions. This read-only review did not execute the simulator suites.

Is this the best way to solve the issue?

Yes. The change consumes the existing Gateway-owned session metadata capability instead of recreating model-scope policy in Swift, with request and session fencing around refreshes.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • 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: Not applicable as a real-behavior merge gate because this is a MEMBER-authored PR and no authority-chain trigger is present; the supplied deterministic iOS fixture recordings are supporting evidence for the visible picker and composer states.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The PR fixes an iOS model-selection and permanent-auth send path that can affect active chat users.
  • merge-risk: 🚨 auth-provider: The composer now disables live sending from Gateway-provided permanent authentication state.
  • merge-risk: 🚨 session-state: Availability is now fetched and refreshed against the selected session, including session mutation and recovery events.
  • 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: Not applicable as a real-behavior merge gate because this is a MEMBER-authored PR and no authority-chain trigger is present; the supplied deterministic iOS fixture recordings are supporting evidence for the visible picker and composer states.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the failed Node compact check and wait for the in-progress iOS screenshot-evidence check before landing.

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 (3 earlier review cycles)
  • reviewed 2026-09-01T10:08:22.226Z sha 20b1a97 :: needs changes before merge. :: [P1] Refresh model availability after session model patches
  • reviewed 2026-09-01T10:22:13.447Z sha 20b1a97 :: found issues before merge. :: [P1] Refresh availability after current-session metadata patches
  • reviewed 2026-09-01T15:16:26.399Z sha d68c2cb :: found issues before merge. :: [P1] Refresh metadata while the catalog is being resynchronized

@fuller-stack-dev
fuller-stack-dev force-pushed the fix/ios-model-picker-scope-availability branch from 20b1a97 to d68c2cb Compare September 1, 2026 14:40
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Reviewed exact head d68c2cb728c126064276f4fab3e235c285640e38: no material findings remain. The prior current-session refresh finding is resolved and covered for both patch and command-metadata, including stale-response fencing. Merge remains gated on exact-head CI and repository landing checks.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Final reviewed head: d20592ba6b3a303b54454ccea567c95449cf7b8b.

The prior P1 is resolved at the shared refresh owner: every chat.metadata.changed event now schedules a newer catalog request, while the existing request and session fences reject stale completions. The held-fetch regression timed out before the fix and now passes. The final apps subtree is byte-identical to the simulator-tested tree (a021119ce75072d8934835caa6d99490cc066857); 1,559 shared Swift tests, 59 XCTest cases, 27 focused iOS tests, and all four UI contracts passed. Source-blind validation: PASS, 0.91 confidence.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 1, 2026
@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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 8f8e774 into main Sep 1, 2026
190 of 191 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/ios-model-picker-scope-availability branch September 1, 2026 19:40
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…35044)

* fix(ios): disclose model selection target

* fix(ios): respect model availability in chat

* test(ios): prove model picker target variants

* chore(ios): refresh native localization inventory

* fix(ios): refresh model availability after session mutations

* fix(ios): refresh model availability during resync
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 merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

[Feature]: Make the model picker write scope explicit (or default row clicks to session scope)

1 participant