Skip to content

Port iOS fixes from 01eef583..911ab132 - #80

Closed
Tarquinen wants to merge 8 commits into
devfrom
ios-sync-911ab132
Closed

Tarquinen wants to merge 8 commits into
devfrom
ios-sync-911ab132

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Ports the iOS fixes from 01eef583..911ab132 that apply to Android. Each fix is its own commit.

  • Saved drafts survive failed writes (iOS 070c2401, 771e0573): a draft's attachment is now written once, not on every keystroke. If a write fails, the saved draft no longer points at a missing file, and old files are deleted only after the new draft is saved. Sent messages free their attachment bytes after two minutes.
  • Every send moves the session to the top of Recents (iOS 0058b803, dae6547c): dictation, Queue and shared sends now count, not only Send. A send that waits for uploads moves the session once it actually goes.
  • Faster cold model picker (iOS 88915116): the model list and the default model load at the same time.
  • Faster attention reads (iOS 417e5b4c): Home checks up to four busy folders for pending questions at once, and only when that set of folders changes.
  • Markdown images from other folders wait for a tap (iOS a17818eb), so they no longer start a server for that folder.
  • Live tool output uses the same limits as the reopened session (tool part of iOS 72a78460): 20,000 characters and 100 items.
  • GPT-Live warms up for one minute (iOS 1735b12e): only on the front screen, not on covered screens or Catch Up cards, and again when a call starts. Before, it re-warmed every 10 s for as long as the screen was up.
  • Settled and covered sessions stop polling (iOS 0d329484, 3d530299, c93c1a47): a settled session on a healthy stream polls every 60 s, with a 120 s watchdog. Screens under a subagent or Settings pause their timers unless a call or browser Ask is live, and catch up when uncovered only if a read came due.

Deferred:

  • Reading a draft file that can't be opened yet (Android has no Direct Boot path).
  • Dropping reasoning text from the stream.
  • Raise to Talk front-screen and proximity changes (not reproduced).
  • The inbox poll waiting for its own read, and the Control Center glance handling (iOS only).
  • Hide/Unhide sessions (a product decision, since Android uses selection mode).

sync.json isn't advanced, because some commits are deferred.

Verified with the ported iOS regression tests, each confirmed to fail without its fix, and a full scripts/check.sh on the Android VM. On the emulator, Markdown images from other folders showed Tap to load and loaded when tapped. The GPT-Live warm-up and polling cadence are covered by unit tests only: warm-up needs a real key, and session-lab doesn't count timed reads.

Port of iOS 771e0573 and 070c2401 (opencode-ios #297, #306).

- Each attachment blob is written once instead of on every draft edit,
  and the blob directory is cleaned only when the referenced set changes
  (and once after launch), not scanned on every flush.
- A manifest is published only after every blob it names was written;
  orphaned blobs are removed only after the manifest without them lands.
  Before, a failed blob write still published the manifest, so a relaunch
  lost that attachment.
- Flushes run one at a time, an older generation no longer cancels a newer
  flush, and removeAll drops a stale flush's results.
- The attachment cache keeps only referenced bytes; delivered outbox sends
  expire after two minutes and let go of their bytes.

Not ported: treating an unreadable state file as an error (070c2401). The
app isn't Direct Boot aware, so the iOS before-first-unlock read can't happen.

Verified: ported ComposerAttachmentPersistenceTests (8 of the 9 iOS cases),
VM `check :feature:composer`. Before (origin/dev probe): typing 20 edits with
two attachments wrote 40 blobs and scanned the directory 20 times; a failed
blob write published the manifest and the relaunch lost the attachment.
Port of iOS 0058b803 and dae6547c. Recents counted only a plain Send:
sending a dictation (DeferredSendReady), a queued message (QueueTapped)
or a share (SharedSendRequested) left the session where it was. Every
composer send now counts once its composer is empty and it isn't answering
a request, so a send still waiting on uploads moves the session only when it
actually goes (no early or double move). Every send but a browser Ask also
donates the share suggestion, as on iOS.

Before (origin/dev): a dictation send left the session below newer ones; a
mid-run send waiting on an upload moved it before it was sent.

Verified: vm.sh check :feature:drawer (adds everySendPathMovesTheSessionTo
TheTopOfRecents, aSendWaitingOnUploadsMovesTheSessionOnceItGoes);
ios-sync.py check.
Port of iOS 88915116. The model list and the default model were read one
after the other, so a cold model picker waited two location-boot round trips.
Both reads now start together; a missing default route still leaves the list,
and a failed list cancels the default.

Before (origin/dev): with the list held open, only GET /api/model was sent
(the new test fails). After: both requests are in flight at once.

Verified: vm.sh check :server (adds modelCatalogReadsTheListAndDefault
Together); ios-sync.py check.
Port of iOS 417e5b4c (#298): the home attention read asked each hot
directory for its permissions and questions one after another, so one
directory booting its instance held up every other directory's dot.
It now asks up to four at once (all must succeed, as before), and the
drawer compares attention directories as sets so the same directories
in a new order don't trigger another read.

Verified: new WireRequestTests.homeAttentionAsksHotDirectoriesAtOnce
fails on the old sequential read (0 of 2 requests for the second
directory while the first is held) and passes now; vm.sh check :server
and :feature:drawer pass; ios-sync.py check reports 0 errors.
Port of iOS a17818eb: a Markdown image outside the session's folder
(`![](/other/project/a.png)`) loaded as soon as its row composed,
reading through that folder's location, which boots that folder's
server instance on the computer. It now shows the same Tap to load
card agent images outside the folder use, and reads nothing until
tapped; images inside the folder, web images and data: images load
as before.

Verified: TranscriptLayoutTests.aMarkdownImageOutsideTheFolderWaitsForATap
(ported); vm.sh check :feature:transcript passes; on the emulator with
session-lab's files checkpoint the two outside images show Tap to load
cards, tapping ringedDot.png loads it and the other stays a card, and
the inside image and drawer.png load untouched.
Port of the tool part of iOS 72a78460: a tool's live input, output and
metadata reached the transcript whole (a megabyte of shell output on
the row while it ran), then shrank to the REST read's 20 000-character
and 100-item bounds once it settled. The stream now applies the same
bounds (`OpenCodeToolBounds`, shared with the REST decoder), so the
live row matches its settled read and huge payloads don't sit in
state. The offscreen Markdown skip from that commit was already here;
dropping reasoning text is deferred (the payload still decodes it).

Verified: ported OpenCodeEventDecodingTests.liveToolPayloadsAreBoundedLikeTheSettledRead
fails on the old decoder (unbounded output) and passes now;
vm.sh check :server passes; ios-sync.py check reports 0 errors.
Port of iOS 1735b12e. With a phone-key GPT-Live route, every resumed
session screen re-warmed the connection every 10 s for as long as it
was up (an HTTPS request to api.openai.com on WebRTC, a fresh socket
on WebSocket), so the radio never idled; a root covered by a subagent
and Catch Up cards warmed too, each on its own loop. Now the screen in
front warms for one minute (LiveSocketWarmer.warmWindow), a call warms
as it starts (also when the project picker opens first), and a WebRTC
warm-up within 5 s of the last for the same key is skipped. Covered
screens and Catch Up cards don't warm.

Verified: ported IdleVoiceSensorsTests (3 in :feature:voice, 1 in
:feature:session); startingAPhoneKeyCallWarmsItsConnectionOnce fails
on the old reducer (no warm) and passes now; vm.sh check
:feature:voice :feature:session passes; ios-sync.py check 0 errors.
Not exercised on the emulator (needs a real OpenAI key).
Port iOS 0d329484, 3d530299 and c93c1a47. A settled session on a healthy
stream (nothing running, queued or waiting) now asks for its requests and
inbox every 60 s instead of 12 s, and re-reads its transcript after 120 s
instead of 20-24 s. A screen something covers (a pushed subagent, Settings,
its own browser) stops its timers unless a call is live on it or an Ask is
under way in its browser; the uncover reads pending work at once and the
transcript only if the watchdog came due. Home's list now reaches each
open screen through its reducer (ActiveSessionsRead), so a subagent the
list shows running first moves its parent to the running cadence. The poll
loops sleep on the watchdog clock, so tests drive them.

Deferred: the inbox loop awaiting its own read, and iOS's Control Center
glance receipts (iOS-only).

Verified: ported 4 session and 3 Home tests from
SessionFeatureTests+QuietPolling.swift; updated the existing cadence
expectations as iOS did; scripts/check.sh on the Android VM passes.
@Tarquinen
Tarquinen marked this pull request as ready for review November 15, 2026 02:36
@Tarquinen

Copy link
Copy Markdown
Member Author

Split into one PR per fix, plus four new ones:

docs/parity/sync.json moves to 911ab132 in a small PR once these have merged.

@Tarquinen Tarquinen closed this Nov 15, 2026

This branch was previously deployed

1 inactive deployment
release — d1fe64d5 Deployed Nov 15, 2026 by Tarquinen via check #242
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