Skip to content

Agent Slider on the phone (Remote revision 68) - #927

Open
sambitcreate wants to merge 15 commits into
mainfrom
claude/ios-agent-slider-phone
Open

sambitcreate wants to merge 15 commits into
mainfrom
claude/ios-agent-slider-phone

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Problem

The Agent Slider shipped on the desktop (#888, #889, #892, #893, #896), but phones still show the old model menu. A chat started on a phone can't pick a stop, and the Mac's per-chat thinking level isn't carried over Remote.

Change

Remote contract revision 68 (chat:agent-slider) carries the Agent Slider to phones. It was written as 66 and renumbered to 68 in the 2026-11-25 merge of main, which had claimed 66 (Bot feed preview) and 67 (Bot session pages) first.

  • Server and CLI
    • The host advertises its stops, home stop and per-stop availability. A stop it can't run comes with a plain reason, and its ids are sent only when it's ready.
    • A turn may name a stop's model and thinking level. The chat's level is saved only when the person picked on the phone (saveSelection), the turn names a provider and model, the host has a slider, and the chat is not a Bot chat. Levels are fitted the way the desktop fits them, and a model with no levels saves null.
    • Mirrored in packages/cli, with the fixtures, OpenAPI and docs/aiden-remote-api-v1.md updated.
  • iOS
    • A Workspace chat's composer shows a slider chip. It opens a sheet on iPhone and a popover anchored on the chip at regular width.
    • Drag, tap or step to a stop; Reset to home; Other models opens the full menu.
    • A new chat starts on the Mac's last model and level.
    • A send carries saveSelection on a new chat's first send and while a pick made on the phone is unsent. That is decided once, when the send is built, and saved with the retry record, so a retry keeps the same body and Idempotency-Key.
    • A new chat's first send made before /models answered names no level. The send captures its intent when it is built, before the optimistic message: the pick it carries, or, with none, where a new chat starts. For a model with levels, the phone resolves that intent against the catalog whenever the catalog arrives, even mid-POST, for the chat as it was before its first message. It never reads chat state or the chip. It keeps the resulting stop, or nothing if that lands on another model or in Custom, rather than a level-less pick, so the next send still saves a level.
    • Covered: a new chat's first send built before the phone knew of the slider (a retry, or a send made before /models answered, including when the catalog lands while its POST is still out) that the Mac accepts once the phone knows of it. The phone keeps the provider, model and level that turn carried as the chat's unsent pick, not the chip's re-resolved choice, and the next send asks the Mac to keep it. This holds even if a refresh filled the chat before the retry was accepted. A newer pick wins, and nothing is kept for a Mac that is no longer paired.
    • Not covered: a send the Mac accepted before the phone knew of the slider, and a reply the phone never read (the app quit after acceptance) whose saved retry is never sent. The chat then follows the Mac's saved level.
    • A stop the Mac can't run shows its reason and can't be chosen.
    • Settings → Agent Slider lists the stops, read-only.
    • The chosen stop and an open sheet survive an iPhone Duo fold.
    • Older Macs keep the model menu.
  • Android: decodes revision 68 but doesn't request chat:agent-slider yet, so an Android reply can never overwrite a chat's stop. The Android UI follows later.
  • Docs: ios/CHANGELOG.md, the Agent Slider plan and docs/plans/README.md, and memory notes.

Scope

Phone half (PR 5) of the Agent Slider plan.

Verification

  • Server, CLI and policy (r5 head e88bf15, after merging main and renumbering to 68)
    • npm run type-check and the packages/cli type-check pass.
    • test:aiden-remote (protocol, router and service suites): 1503 passed, 0 failed, 2 skipped.
    • test:ci-policy 128/128.
    • Earlier heads: test:ios-release 33/33 and the shipping-target check 14/14.
  • Android: testDebugUnitTest on an earlier head. The renumber changes only the expected contractRevision in four Android tests.
  • iOS (r7 head a77c925): AidenChatTests and AidenAgentSliderTests 408/408 (serial). The new catalog-lands-mid-POST case failed on the e88bf15 code with 7 assertion failures and passes on a77c925. The r7 change is Swift-only plus docs, and touches no test registry.
  • iOS (r5, e88bf15): AidenChatTests and AidenAgentSliderTests 408/408 and the slider XCUITest (2/2) on iPhone. Earlier heads also ran the slider XCUITest on the closed iPhone Duo and iPad (regular width). In the first r5 run, one test (testAgentSliderStopIsSentExactlyAndAMacWithoutItKeepsTheModelMenu) failed with no assertion because the simulator failed to relaunch the test host. It passed alone and in a serial rerun of both suites.
  • Review: five adversarial rounds covering server/contract and iOS (Swift concurrency, iPhone Duo), plus Pullfrog rounds through r7. The first round's blocker and 7 majors are fixed in 118a7a8; later rounds are listed under Review rounds.
  • Known flakes seen locally, not caused by this change: CLI parity.test.mjs:2318, the Tailscale case in aiden-remote-service.test.ts, and an AidenBotPeersTests hang.
  • Flaky on hosted CI, not caused by this change: Linux E2E on aeaca72 failed in the desktop spec e2e/inline-visuals.spec.ts:348, where the evaluate promise was garbage-collected before it settled. The Linux arm64/x64 gate failures on that head follow from that one job. The spec doesn't touch the slider, and this push starts a fresh run.
  • Not verified: the Duo's open display and a real fold can't be driven from the command line. The open-display behaviour is covered by the regular-width runs.

Screenshots

Before: a Workspace chat's composer shows the model menu. That's unchanged on Macs older than revision 68.

After (iPhone):

Composer Sheet (home) Sheet (Deep) Answered on Deep

iPhone Duo, closed (compact):

Composer Sheet (home) Sheet (Deep) Answered on Deep

Regular width (iPad; stands in for the Duo's open display), popover:

Composer Popover (home) Popover (Deep) Answered on Deep

Review rounds

There were five adversarial review rounds plus Pullfrog. The round-2 fixes are in d1db649:

  • A new chat's first send now saves its stop, so the chat no longer switches to Custom after the Mac's copy syncs back.
  • The iOS stop decoder now accepts ids and a level only on ready, matching the host and Android.
  • OpenAPI now rejects thinkingLevel on Bot chats.
  • The API doc's iOS paragraph is rewritten to match the code.

Later rounds:

  • 215aca2: a late-granted first send keeps its stop; the compact sheet re-measures on width and text-size changes; Settings shows skeleton rows while the slider loads.
  • aeaca72: whether a send keeps its selection is decided once, when it is built, and saved with the retry record, so a retry keeps its body and Idempotency-Key. Pullfrog's late-grant finding is fixed here.
  • fb5c2ac: a first send made before the catalog no longer leaves the chat in Custom. The fake Mac in the slider test follows the real idempotency ledger (a changed body under the same key is 409 idempotency_conflict, and a replay returns the original message id), and a test round-trips a saved retry's keepsSelection through the on-disk store. Docs note that a retry saved by an earlier build reads as not keeping a level.
  • a77c925 (r7, Pullfrog): a pre-catalog first send no longer loses its stop when the catalog lands while its POST is in flight. Fixed at the root. The send's intent is captured when it is built (PendingSend.startsWhereNewChatsStart, saved with the retry record), and keptSelection(for:) resolves it against the catalog for the chat as it was before its first message. This replaces lateGrantedPick's dependence on chat state and currentStop. resolveModelSelection applies the same intent while that send is in flight or waiting to retry, so the chip shows the start stop at once. A pick made meanwhile still wins, now via a pick-generation counter as well as hasUnsentModelPick. A removed or re-paired Mac still keeps nothing, and Send is never held.

Follow-ups

  • Recheck revision 68 against main right before merging, and bump it if main has claimed 68.
  • The iPad popover's arrow sits slightly right of the chip.
  • The Android slider UI.
  • When the composer switches layout (a run ending, or a text-size change), it replaces the chip that presents the slider, so an open slider can close. The fix moves the presenter out of the shared composer surface and gives the popover its own anchor. That touches the Duo fold handling, so it is left for its own change.
  • The compact sheet can still grow once, from medium to its fitted height, the first time it opens.
  • Design question: whether Other models should offer "no level".
  • The chosen stop isn't remembered when a chat reopens if two stops share a model and level; fixing it needs the stop id persisted.

AI disclosure

Written with Claude Code agents. A person reviews before merging.

Checklist

  • I tested these changes locally and reviewed the diff myself
  • Related docs / tests are updated where behavior, settings, or contracts changed
  • No unrelated refactors or changes are included

GET /models gains agentSlider (stops, home stop, each stop's fitted
model and thinking-level resolution). Chats carry thinkingLevel, and a
phone holding the opt-in chat:agent-slider capability saves its sent
selection in the same write as the user message, so a refused send
leaves nothing behind. Desktop server and aiden serve both wire it;
aiden serve has no slider, so phones fall back to the model menu.

Contract revision 66 must be rechecked against main at merge.
Negotiates chat:agent-slider alone, decodes agentSlider on the model
catalog and thinkingLevel on chats, and checks the shared fixture
through the real client. The Android slider UI is deferred.
The composer's model menu becomes a slider chip when the paired computer
offers chat:agent-slider and the phone holds it. The sheet shows the
computer's stops on a track, Reset to home and Other models; stops that
can't run are shown but can't be chosen. Each send carries the stop the
user saw, and stale catalog or chat loads never overwrite the current host
or chat. The open sheet and the chosen stop live on the chat view model, so
they survive an iPhone Duo fold. Settings gains a read-only Agent Slider
page. Adds resolver unit tests, decoder and fixture tests on iOS and
Android, a demo slider host and an XCUITest that sends on a chosen stop.
Server and contract (revision 66):
- Only a phone pick the person made saves the chat's level: turns carry
  saveSelection, and the host saves only when the turn names a provider
  and model, the host has a slider, and the chat is not a Bot chat.
- A saved level the model does not offer is fitted the way the desktop
  fits it, rather than refused; a model with no levels saves none.
- Stop projection follows the phone catalog's allowlist: ids are sent
  only for ready stops, and the reason a stop can't run carries labels.
- Android decodes the slider but no longer negotiates the capability,
  so its turns cannot overwrite a chat's stop.

iOS:
- A new chat starts on the computer's last model and level; Reset to
  home returns to the home stop. A late slider grant re-resolves a
  derived level.
- The slider opens as a popover anchored on the composer chip at
  regular width and a sheet at compact width, and the open sheet and
  chosen stop survive a fold.
- Reason texts never show raw ids; focus ring and accessibility fixes.
- UI test starts from a cleared model preference and a demo chat on
  its home stop, so earlier runs can't decide the first stop.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

An untouched new slider chat loses its default stop after the first authoritative refresh, and the iOS decoder accepts a malformed known-unavailable stop shape that the other revision-66 decoders reject.

Reviewed changes Reviewed the complete revision-66 diff and traced its model-selection authority through the desktop host, iOS, Android, fixtures, OpenAPI, and focused tests.

  • Remote revision 66: Adds chat:agent-slider, slider projection and availability, chat-level projection, fitted turn levels, and atomic saveSelection persistence while leaving aiden serve unadvertised.
  • iOS slider experience: Adds capability negotiation, exact stop resolution, the composer chip and adaptive presentation, read-only Settings, fold-surviving state, demos, and behavioral coverage.
  • Android and shared contracts: Adds tolerant Android decoding without negotiation, shared fixtures, OpenAPI definitions, protocol tests, and product/plan documentation.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread ios/AidenOnTheGo/Models/AidenChat.swift Resolved
Comment thread protocol/aiden-remote/v1/openapi.json Resolved
Comment thread docs/aiden-remote-api-v1.md Resolved
…stop and chat contracts

- A new chat's first send on the phone now carries saveSelection, because
  the host stores no level when it creates a chat; without it the chat came
  back off the stop it started on after the first message. The demo Mac now
  keeps a turn's level only with saveSelection, as the host does, and the
  slider UI test sends a plain follow-up that must stay on the chosen stop.
- A slider that arrives after the catalog re-derives a new chat's selection
  from scratch, so a level fitted without the slider isn't kept.
- The iOS stop decoder refuses ids or a level on a stop that isn't ready, as
  the TypeScript and Android decoders do; the demo's not-signed-in stop no
  longer sends a level.
- OpenAPI Chat and ChatMessagesWindow refuse thinkingLevel with botId.
- The sheet's chrome height scales with Dynamic Type and its fitted height
  only grows, so stepping between stops doesn't resize it under a finger.
- Docs: the API doc's iOS client paragraph now covers the popover, Settings
  → Agent Slider, the phone's remembered pick and when saveSelection is
  sent; Settings copy, PROJECT_SPEC, CHANGELOG and the plan match.
- Comment fixes: modelLabel can be the model id; two misplaced or badly
  wrapped Swift doc comments.

---
Generated by Claude Code

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

A saved first-send retry can still lose the Agent Slider stop when the capability appears after the request was persisted.

Reviewed changes Reviewed the d1db649 fix round against the prior Pullfrog review, including the iOS first-send authority path, strict stop decoding, OpenAPI Bot exclusions, demos, tests, and corrected product documentation.

  • Preserved fresh-chat stops: Added saveSelection to a newly constructed first turn, then exercised authoritative reconciliation and a plain follow-up.
  • Tightened revision-66 contracts: Rejected known unavailable iOS stop shapes carrying IDs or levels and aligned both OpenAPI chat projections with the Bot exclusion.
  • Aligned client behavior and copy: Updated the demo host, settings copy, API guide, changelog, project spec, and plan status to match the implemented defaults and adaptive presentation.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

…sure the sheet, skeleton Settings

A new chat's first send saved before the Mac granted the Agent Slider has
no saveSelection, and its retry must resend the same body under the same
Idempotency-Key (the Mac answers a changed body with idempotency_conflict).
Once that retry is accepted while the phone holds the slider, keep the
chip's choice as the chat's unsent pick, so the chat stays on its stop and
the next send asks the Mac to keep it.

- The slider sheet's measured height shrinks as well as grows when the
  width or Dynamic Type size changes, and only grows within one layout.
- Settings shows skeleton rows while the slider loads, keeps the loaded
  stops on Try again, and its footer says only a pick made in a new chat
  is remembered, stop or model.
- The demo Mac serves the slider for a new chat, and a UI test covers a
  new chat's first send and follow-up on iPhone and Duo.
- saveSelection doc comment, test doc placement, CHANGELOG, PROJECT_SPEC
  and the Remote API doc updated.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The retry fallback still loses the intended Agent Slider stop when a host-accepted first send is reconciled before its saved request is replayed.

Reviewed changes Reviewed the 215aca2 fix round against the prior Pullfrog review, including the late-grant retry state machine, compact-sheet remeasurement, Settings loading state, demo behavior, focused tests, and updated product documentation.

  • Preserved immutable retry bodies: Kept a pre-grant retry request and idempotency key unchanged, then recorded the current chip selection as an unsent per-chat pick after acceptance.
  • Remeasured adaptive sheets: Reset the fitted compact-sheet height when width or Dynamic Type changes while retaining grow-only sizing within one layout.
  • Refined Settings loading: Replaced the spinner with accessible skeleton rows and retained a same-computer catalog during explicit reloads.
  • Extended regression coverage and docs: Added the late-grant retry scenario and new-chat UI flow, then documented the immutable-body fallback across the Remote guide and iOS product records.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Whether a send is a new chat's first send or carries an unsent pick is now
decided once, when the send is built, and saved with its retry record
(PendingSend.keepsSelection). A retry reads it instead of asking again, and
its body and Idempotency-Key stay unchanged, since the Mac answers a changed
body under the same key with idempotency_conflict.

When such a send went out without saveSelection and the Mac accepts it once
the phone holds the slider, the phone keeps the provider, model and level
that turn carried as the chat's unsent pick, not the chip's current choice,
which the slider's arrival may have re-resolved. A newer pick made while
the send was out wins. The remembered pick is written only while the Mac's
pairing is retained, the same check other installation-scoped writes use.

Covered: a new chat's first send built before the phone knew of the slider,
whether retried or sent before /models answered, that the Mac accepts once
the phone knows of it, including when a refresh filled the chat before the
retry was accepted.
Not covered: a send the Mac accepted before the phone knew of the slider,
and a send whose reply the phone never read (app quit after acceptance)
whose saved retry is never sent. The chat then follows the Mac's level.

Nothing new gates Send on the catalog or a host round-trip.

Tests: the late-grant fixture now expects the stop its first turn ran on;
new cases for a refresh before the retry is accepted and for forgetting the
Mac during the retry. CHANGELOG, PROJECT_SPEC and the Remote API doc state
the covered cases.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Reviewed the aeaca72 fix round since the prior Pullfrog review, including the persisted retry intent, immutable-request fallback, host-retention fence, focused iOS state-machine coverage, and aligned product documentation.

  • Persisted selection intent: Captured whether a send must keep its selection in PendingSend.keepsSelection and preserved it across manual, restored, and rate-limit retries.
  • Restored the actual turn selection: Reapplied the provider, model, and level carried by a late-granted immutable request after acceptance while allowing a newer phone pick to win.
  • Closed the lost-reply ordering gap: Covered transcript reconciliation before retry acceptance and prevented a forgotten or re-paired host from retaining the recovered per-chat preference.
  • Aligned documentation: Updated the Remote guide, iOS changelog, project specification, plan, and memory to describe the final retry semantics and intentional limitation.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

…re the catalog

A new chat's first send made before GET /models answered names the chat's
model with no level, because the phone knew none, and the turn runs on the
model's own setting. Holding that as the chat's pick after a late slider grant
put the chat in Custom and made the next send save no level. For a model with
levels the phone now holds the stop the chip resolved to from the catalog, or
nothing in Custom; a turn with a level, or a model without levels, still holds
exactly what the turn ran on.

The fake Mac in the slider test now follows the real idempotency ledger: the
same key with a different body is 409 idempotency_conflict, and a replay
returns the original message id, so the chat shows the message once. A new
test round-trips a saved retry's keepsSelection through the on-disk store.

Docs: the API doc, CHANGELOG and PROJECT_SPEC describe the no-catalog case and
that a retry saved by an earlier build reads as not keeping a level.
main now holds revision 66 (Bot feed preview) and 67 (Bot session pages),
so the slider claims the next revision after main's. Every slider reference
moves together: the host constant, packages/cli, iOS, Android, the contract
fixture, openapi and docs/aiden-remote-api-v1.md. Pre-slider references
that named 65 now name 67.
…er-phone

# Conflicts:
#	android/app/src/test/java/sbtbiswas/AidenOnTheGo/AidenBackgroundJobsTest.kt
#	android/app/src/test/java/sbtbiswas/AidenOnTheGo/AidenBotAccessRequestsContractTest.kt
#	android/app/src/test/java/sbtbiswas/AidenOnTheGo/AidenBotPlanContractTest.kt
#	android/app/src/test/java/sbtbiswas/AidenOnTheGo/AidenRemoteClientTest.kt
#	docs/aiden-remote-api-v1.md
#	ios/AidenOnTheGoTests/AidenBackgroundJobsTests.swift
#	ios/AidenOnTheGoTests/AidenBotPlanTests.swift
#	ios/AidenOnTheGoTests/AidenBotSessionTests.swift
#	ios/AidenOnTheGoTests/AidenRemotePhase0Tests.swift
#	main/services/aiden-remote-protocol.test.ts
#	main/services/aiden-remote-protocol.ts
#	protocol/aiden-remote/v1/fixtures/contract.json
@sambitcreate sambitcreate changed the title Agent Slider on the phone (Remote revision 66) Agent Slider on the phone (Remote revision 68) Nov 25, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new pre-catalog first-send recovery still drops the stop when the catalog arrives during the in-flight POST.

Reviewed changes Reviewed the changes since the prior Pullfrog review at aeaca72, including the no-catalog first-send fallback, retry persistence and idempotency fixture, the merge from main, and Remote revision 68 parity.

  • Recovered pre-catalog first sends: Added lateGrantedPick(for:) so a level-less request on a levels-bearing model can retain the stop resolved after the catalog arrives instead of persisting Custom.
  • Hardened retry state: Round-tripped PendingSend.keepsSelection through disk and made the fake host enforce immutable idempotency bodies plus replayed message identities.
  • Renumbered the Remote contract: Moved chat:agent-slider from revision 66 to 68 after main claimed revisions 66 and 67, updating desktop, iOS, Android, fixtures, OpenAPI, tests, and docs together.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

… lands mid-POST

A new chat's first send built before GET /models answered names no level.
If the catalog and slider grant landed while its POST was still out, the
optimistic message made the chat look populated, so resolution followed the
chat's nil level into Custom and the acceptance hold gave up on a nil
currentStop: nothing was kept and the next send saved no level.

The send now captures its intent when it is built (startsWhereNewChatsStart,
saved with the retry record) and keptSelection(for:) resolves it against the
catalog on the chat as it was before its first message, never from chat
state or the chip. resolveModelSelection applies the same intent while such
a send is in flight or waiting to retry. A pick made meanwhile still wins
(modelPickGeneration plus hasUnsentModelPick), a removed or re-paired Mac
still keeps nothing, and Send is never held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The in-flight catalog fix still resolves a captured send intent from mutable cross-chat preference state.

Reviewed changes Reviewed the two commits since the prior Pullfrog review at e88bf15, covering the pre-catalog first-send intent state, its retry persistence, concurrent-pick fencing, the held catalog/POST regression test, and aligned revision documentation.

  • Captured first-send intent: Added startsWhereNewChatsStart, sendInFlight, and a pick-generation fence so catalog arrival during a successful first POST no longer resolves from the optimistic message.
  • Resolved the original race: Replaced lateGrantedPick(for:) with catalog-based intent resolution against an empty chat and retained the resulting stop for the next saving send.
  • Extended ordering coverage: Held /models and /turns in the previously failing order, then asserted the chip, retained per-chat selection, authoritative reconciliation, and follow-up saveSelection request.
  • Aligned documentation: Recorded the revision-68 renumbering and the new pre-catalog send semantics in the Remote guide, iOS product records, plan, changelog, and project memory.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

selectedProviderId: nil,
selectedModelId: nil,
selectedThinkingLevel: nil,
remembered: isReadOnlyFixture ? nil : modelPreferenceStore.selection(for: instanceId),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rereads the shared per-host preference after the send was built, so startsWhereNewChatsStart does not freeze the original selection. If another new chat changes that preference while /models or the POST is outstanding, this chat can adopt the newer level or lose its retained stop instead of preserving this send's intent.

Technical details
# Freeze the original new-chat selection

## Affected sites
- `ios/AidenOnTheGo/Features/Chat/AidenChatViewModel.swift:1833-1835` — the pending send captures only a boolean intent.
- `ios/AidenOnTheGo/Features/Chat/AidenChatViewModel.swift:3020-3025` — resolution rereads mutable host-wide preference state; the provider/model guard cannot detect a same-model level change.
- `ios/AidenOnTheGo/Persistence/AidenModelPreferenceStore.swift:64-83` — another new chat can replace that shared preference while this send is outstanding.

## Required outcome
- Persist enough immutable intent with the pending send to resolve the new-chat selection that existed when the send was built, even if another chat changes the host-wide preference before catalog or POST completion.
- Keep a newer explicit pick in this chat authoritative and preserve retry-body/idempotency behavior.
- Add focused cross-chat ordering coverage for a preference change while the first send is outstanding.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant