Repository navigation
Add agent update monitoring and controls on desktop and iOS - #389
Conversation
b75baed to
b342b4b
Compare
wingleeio
left a comment
There was a problem hiding this comment.
Reviewed the full diff at 583de5f and ran the engine, harness, RPC and proto suites locally on Linux (engine lib 221 passed, harness lib 182 + codex 22, rpc 15, proto 31). CI is green on the head. I also pulled the real codex-package-x86_64-unknown-linux-musl.tar.gz from rust-v0.155.1 and its layout and codex-package.json match validate_codex_package exactly, so the standalone path should work against the live release.
This is careful work: the lease/marker design, SHA-256 + size verification, nonce-scoped staging, atomic current swap, and process-group cleanup all hold up. One engine regression is blocking for me; the rest are smaller.
Blocking
Queue flushing for every chat stalls while any one harness update waits or installs. SessionsEngine::dispatch now awaits registry.execution_lease(harness_id) (crates/engine/src/sessions.rs:372), which spins on update_generation.changed() for as long as update_pending is set, i.e. from begin_update through post-install verification (minutes, up to the 15-minute updater timeout). Every caller of dispatch awaits it inline: DocHost::drain_queue holds the chat's drain_lock across it, and spawn_queue_flush_watcher (doc_host.rs:843-853) is a single task that awaits drain_queue for all chats serially on every status change. So:
- Claude update accepted while chat A is mid-turn on Claude → phase
WaitingForIdle. - Chat B (Claude) has a queued message; the watcher hits B's
drain_queue→dispatch→ blocks on the lease. - Chat C (Codex) finishes its turn; its held message never releases until the Claude update fully completes, because the watcher is stuck in step 2. Same for
chat_taskon chat B (doc-change handling is behind the blocked drain).
Before this PR dispatch only awaited short things (interrupt grace). Suggestion: don't block in dispatch. Either acquire the read lease inside the spawned run task before harness.run(...) (the writer is already queued so ordering is preserved), or have dispatch try_read/check update_pending and return a "deferred" outcome so drain_queue leaves the row queued and re-drains on update_generation change. note_turn_start also fires before the wait, so a dropped dispatch has already reported a turn start.
Should fix
- iOS: Cancel produces a spurious error banner.
HarnessUpdates.swift:427-441:ApplyHarnessUpdateis awaited for the whole update (20-min deadline). When the user taps Cancel, the engine'sapply()returnsErr("update cancelled"), so the still-pending apply call throws andaction()writes "update cancelled. Reconnect to check the device's status before retrying." into the pane, while the watch correctly returns the row to Available. Demo mode masks this becauseDemoHarnessUpdates.applyreturns normally after cancel. Treat a cancel-originated failure of the apply key as benign. - Settings → Agents swallows the watch error.
crates/ui/src/settings/harnesses.rs:325-352:updatesis set toLoadable::Error(...)but onlyLoadable::Readyis ever rendered (lines 258, 1160), and the real error at :339 is immediately overwritten by "Reconnecting to device…" at :347 before a paint. A remote engine that hard-failsWatchHarnessUpdatesleaves the page retrying forever with "Check now" greyed and no explanation. - Desktop banner debounce can be starved.
crates/ui/src/shell.rs:2294-2296: everyon_state_changedwith an unseen Available row re-assignsharness_update_banner_task, dropping the previous 1 s timer, and nothing entersharness_update_seenuntil a timer fires. During an active run AppState notifies far more than once a second, so the banner never posts until the app goes quiet. Only spawn when the task isNone(or clear it after firing).
Nits
extract_versionpicks the numerically largest dotted token in the output (harness_updates.rs:1648-1655). Any vendor that prints a runtime/Node version alongside its own would be misread as a newer install. Preferring the first token, or the token following the CLI name, would be safer.harnesses.rs:1229,1235hardcode "Cursor SDK 1.0.28" / "pi-acp bridge 0.0.33" with no shared constant; the next adapter bump silently makes Settings lie.shutdown()can wait an extra ~4 s in the success path because the last mutate beforecancellations.removeis theUpdatedpublish, and the next one is the 4 sUpdated → Currenttimer.open_harness_update_stepspasses the local device id toset_target_device(the page's own switcher usesNonefor local), which discards the page's initialload()and re-subscribes twice per open. Works, just wasteful.- Demo only:
DemoHarnessUpdates.cancel()cancels theapplyRuntask before checkingcancellable, so a programmatic cancel duringinstallingleaves the fixture row spinning forever.
618db34 to
319a721
Compare
|
Desktop visual review at 319a721; mobile screenshots refreshed September 25 at 15af555. The desktop update island now has the tighter compact layout, Settings-style material and separators, a 3.5-row viewport with fades and the small scrollbar, clipped rounded corners, and glyph-only activity (no loading bar). Desktop captures use the production GPUI renderer with synthetic update data, at 960 × 720 points. Mobile captures are from a fresh native build on iPhone 17 Pro / iOS 26.3 Simulator using the offline demo dataset. The iOS app currently forces dark mode. Versions and errors shown are fixtures.
Mobile refresh: native sheet corners, compact version rows, and native toolbar controls. Build and both agent-update UI tests passed. Mobile provenance.
Capture provenance and reproducible fixture. These stills verify the captured layouts; they do not establish animation smoothness or live update success. Capture-only changes were removed from the contribution branch. Historical validation at 319a721: local Rust application/test/example compilation and the SDK contract check pass; the fresh iOS app build passes. CI now passes Windows, desktop UI, macOS frame recovery, Linux browser, networking, session sync, and Cursor compatibility. The remaining red job is iOS unit tests: |
|
Fixed the iOS failure from the linked run in 9a69f83. The CI motion attachment shows the first reversal at y=588 toward a hidden endpoint of y=778. The next observed frame is y=796: the keyboard spring has overshot and is still settling. The test required The test now accepts spring overshoot while retaining the minimum travel and >1-point endpoint-distance conditions. It still requires all five observed in-flight reversals, a settled hidden keyboard, and <4-point transcript attachment error. Production code is unchanged. Validation on a clean iPhone 17 Pro / iOS 26.3 Simulator: the focused test passed, then all 9 regression executions passed (three repetitions each of interrupted motion, streaming runway anchoring, and repeated viewport layout). The focused motion trace completed five reversals with maximum gap drift of 0.031 points. Local testing also exposed a stale simulator keyboard state; that simulator was replaced for verification, without skipping or relaxing the assertions. Pushed for a fresh CI run; remote results are pending. |
17a8109 to
a7530b3
Compare
|
Rebased onto Resolved both conflicts, retaining the silent-subscription and device-update-watch RPC regressions and main’s relay callback behavior. Fixed the accepted-cancel/install race: cancellation and the final transition to Installing now share a synchronized boundary for vendor commands and staged Codex activation. A regression covers both orderings and concurrent contenders from Preparing and Downloading. Verification of the final source:
Device scope: desktop Home aggregates supported hosts, with per-device actions and disabled actions for offline hosts. iOS manages the selected host; the phone does not run a local CLI updater. Captured the rebased iOS demo pane locally; reopen with |
|
Mobile layout polish pushed in
Verified an iPhone 17 Pro / iOS 26.3 build with native screenshots at default and XXXL text sizes. Both HarnessUpdatesUITests passed, exercising Cancel, Update, Retry, device navigation, offline state, and pane resizing. Other viewport sizes, RTL/pseudo-localization, accessibility text sizes, and slowed motion were not verified. |
5d139f8 to
1cb7b6c
Compare
|
Addressed all three policy/cancellation findings in
Validation: 28 updater tests passed, including new regression coverage for automatic versus explicit Notify transitions, versionless Hermes cancellation, and final policy checks in Preparing/Downloading. |
|
Fixed the discovery-lock bypass and versionless notifications.
Regression coverage exercises both real RPC dispatch branches under an exclusive installation lease, checks the project root passed to each adapter, aborts the RPC, and verifies that another installation stays blocked through discovery cleanup. The native Shell aggregation regression includes Hermes and Codex, repeated checks, and re-arming after Current. Pushed and tested at
The notification test verifies shell aggregation and deduplication; live OS notification delivery was not exercised. |
Related issues and PRsReviewed the 55 open issues and 72 open PRs. No open issue is fully resolved by this PR, and no other open PR duplicates its agent-update monitoring and controls scope. Related issues — keep open
Related PRs to coordinate with
Recommendation: reference #336 and #477 as related work, without closing keywords. No issue closure is warranted by this PR's current scope. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at shutdown
`grok update --check` prints the installed version before the candidate
("available: 1.0.4 -> 1.0.41"), so taking the first version token made
every Grok release look current. Command-based checks now take the final
version token.
The periodic worker awaited an in-flight check_all during shutdown, which
could hold engine teardown for the full probe and registry timeouts. The
check now races the shutdown token like the worker's sleep.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The turn-end flush watcher drains chats serially. With a Claude update waiting on another Claude run, a held Codex row must still flush when its turn ends, and the held Claude row must start only after the update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wingleeio
left a comment
There was a problem hiding this comment.
Thanks for the thorough rework — this is in great shape now.
Previous round, all resolved
- Queue stall (blocking):
dispatchno longer waits on the execution lease.drive_runacquires it after the run is spawned (interruptible), shares it with the adapter through cleanup, and parked persistent sessions retire when an update is pending. I verifiedpending_update_does_not_stall_another_chats_queue_flushfails (times out) if the old inline wait in dispatch is reintroduced, and passes with this branch. - iOS Cancel: the in-flight apply's
update cancelledresult is now swallowed instead of surfacing a reconnect error. - Settings watch errors: they're now kept instead of being overwritten by "Reconnecting…".
- Desktop banner: the per-device watch model (
reconcile_devicesonly starts a watch when none exists) removes the re-spawn/starvation issue. - Version extraction: installed versions take the first version token and update checks take the last.
Pushed on top (plus a merge of main):
2dbfe3f4:grok update --checkprints1.0.4 -> 1.0.41, so the candidate is now read from the final version token (previously every Grok release looked current). The periodic worker's in-flightcheck_allalso races the shutdown token, so engine teardown doesn't wait out slow probes.73fc62f5: regression test for the cross-chat queue flush while an update is pending.
Tested locally: proto 46, rpc 16, harness lib 277, engine lib 357, message_queue 26, rich_composer_delivery 5, e2e 23, harness codex 27, and the ui harness_update tests. All pass. CI is green, including iOS and Windows.
Optional nit: download_codex_archive only compares against asset.size after the stream ends. Aborting as soon as completed exceeds the expected size would bound disk use if the asset host ever misbehaved (the SHA-256 check already guarantees integrity).
Resolve the conflicts with immediate steering (zeronsh#498) and the explorer work (zeronsh#508, zeronsh#568): - Warm dispatch and steer_at keep main's mailbox backpressure and fork history bootstrap. The reserved slot is committed together with the update marker, so an accepted update releases it and the prompt waits behind the update as before. - deliver_prompt keeps main's early transcript write for sends held by backpressure, except while the chat's agent has an update pending; that send is held in the queue instead (the e2e deferred-steer test requires it to stay out of the transcript). - Update-deferred sends reuse main's hold_until_turn_end, which dedupes redelivered commands and keeps an explicit steer ahead of queued rows. - Devin's catalog probe keeps the reaped-child lease handling and parses main's grouped catalog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the iOS agent-updates screen: the iOS rewrite on the Rust core (zeronsh#570) replaced the Swift app it was built on (RelayError, WorkspaceStore, DemoDataset, the old AppModel), and the new project compiles every Swift file in the app folder. apps/ios now matches main exactly; the update RPCs stay forwardable so the new app can add a screen on its own architecture. Also give main's new steering probe examples the RunControls execution_lease field, and keep both shell modules added in parallel (harness_updates and the right-pane navigation work from zeronsh#571/zeronsh#572). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Heads-up: I merged main again ( Also in this merge: main's new steering probe examples get the |
Brings agent update monitoring and controls (zeronsh#389, zeronsh#596), completion discovery in unsaved side chats (zeronsh#588), the sidebar star banner (zeronsh#586, pointed at the fork repo), mobile steering and queued images (zeronsh#592) and the iOS follow-ups. Upstream zeronsh#595 (durable desktop app updates) is reverted on top of upstream (a65f309) before the merge: Comet has no release feed of its own. New harness-update RPCs are registered in the fork's typed registry; execution leases are threaded through the fork's title/recap/commit retry paths, Workers checkout reservations and session grants stay. OMP/Kimi stay out of the harness update coordinator (Workers maintenance already updates omp/pi). Decisions: docs/upstream-sync.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122ykZEFtNWWut4VkghZ1DQ
) 20 tickets over 15 portable commits: engine steer/queue fix, side chats + explorer sections + roboco-mcp injection (zeronsh#498 line), five independent UI fixes, agent update monitoring (zeronsh#389), durable desktop updates (zeronsh#595, roboco-adapted) and the Windows Inno installer rider. Stacked on PR #13.
Port of zeron 35a9139 (zeronsh#389) engine/proto/rpc/harness layers: periodic version checks for installed agent CLIs with update decisions, update leases/locking (registry execution gates extend the wave-2 Installations guard pattern: shared read leases for runs/titles/catalog discovery, a write-preferring exclusive lease for accepted updates, and a pending-update marker that retires parked persistent sessions), provider self-update execution with process-group cleanup, the Codex standalone download/verify/atomic-activate path, per-engine preferences (harness-update-prefs.json), the quiet Watch/Check/Apply/Cancel/Dismiss/ SetPolicy RPC surface, and the harness-updates-v1 capability. Adaptations (per ticket 18): - Engine-local only (ADR 0004): upstream's relay/forwardable routing, forward deadlines, and LinkCache plumbing are dropped — the RPCs are served by the engine that owns the CLIs. Per-device semantics map to per-engine routing (the Settings device switcher retargets). - Crate/identifier renames (roboco-*, Roboco) and Roboco's native pi harness instead of upstream's pi-acp bridge; Antigravity's update target is its managed ACP server binary. - compose_child_path is now pub (update probes compose the child PATH exactly like chat runs). - RunControls gains execution_lease and Harness gains executable_path; harnesses retain the lease until their child is reaped. Excluded: .github/workflows/cursor-compatibility.yml (CI policy — Roboco's CI stays windows.yml/ui-tests.yml/preview-tests.yml/ web-codegen.yml/theme-artifact.yml/web-engine-client.yml/release.yml); upstream's terminal/ConPTY test-infra refinements and mobile-only hunks. Tests: harness_updates suites (checks, leases, downloads, Codex standalone activation, cancellation serialization, shutdown), registry gate_tests, model_catalogs lease tests, instance_lock unix drop release, e2e deferred-steering + non-blocking dispatch, message_queue cross-harness flush, rich_composer_delivery discovery-lease, codex fixture lease-shutdown (fake fixture only, no live probes).
…eam 35a9139 + 9d3cc8b) Port of the desktop surface from zeron 35a9139 (zeronsh#389) with the folded ticket-03 end-state from 9d3cc8b (zeronsh#596): - Home agent-update card (shell/harness_updates.rs): one bottom-anchored surface (compact summary + expandable list) riding the dock's choreography, matched to Settings material and the settings scroll rail, glyph activity only while an update is mutating, escape collapses it. - Settings → Agents: each provider row becomes an expandable details row with a STABLE FIXED-WIDTH chevron (upstream 9d3cc8b); the one update/cancel action sits inside the details trigger BEFORE the chevron so its appearance never moves the chevron; the expanded details carry the Updates section — policy select with short menu labels (Notify / Auto when idle / Off) and the chosen policy's explanation under the row title. No 'Ignore version' control: Off covers it, DismissHarnessUpdate stays engine-side (folded 03). - Settings → Notifications: 'Agent updates' banner preference (agent_update_notifications, sub-option of desktop banners). - Desktop banner for newly discovered agent CLI releases, debounced into one aggregate, version-deduplicated, routed to Settings → Agents through the reserved notify target. - AppState.harness_updates: the standing WatchHarnessUpdates stream on the connected engine, capability-gated on harness-updates-v1. - engine_registry call deadlines for CheckHarnessUpdates (4 min) and ApplyHarnessUpdate (20 min). Adaptations: per-device maps to per-engine — the card surfaces the CONNECTED engine's statuses (no multi-engine inventory, no per-host watches, no targetDeviceId routing from the card; the Settings page retargets through request_routing::device_target exactly like its install/enablement writes). Roboco's native pi harness gets the "Managed by Roboco" meta note; upstream's iOS/mobile hunks excluded. Tests: banner debounce/dedup episode test, expanded-preferences render test, policy menu + label copy tests, card row identity/action tests.








Summary
Show installed coding-agent CLI updates across supported devices in the desktop Home composer, with a device label on every row and independently targeted controls. Settings and local desktop notifications remain available while in a chat; the Home card itself stays on the new-chat page. iOS manages updates on a selected host from Devices. Updates wait for active runs to finish and continue if the initiating view closes or its relay disconnects.
harness-updates-v1and recover watches after reconnecting.PI_ACP_EXECUTABLEand custom ACP adapter paths, while preserving native ACP overrides. Check@earendil-works/pi-coding-agentreleases and handle Hermes commit updates without inventing a version.Screenshots
Mobile screenshots refreshed September 25, 2026 from 15af555, using the iPhone 17 Pro / iOS 26.3 Simulator and demo data. They show native sheet corners, compact version rows, and native toolbar controls. Desktop screenshots below remain historical September 16 references.
Desktop — expanded update list in light appearance (01:14:58).
iOS — agent updates and device picker (September 25). Versions and errors are demo fixtures.
Mobile capture provenance. Build and both agent-update UI tests passed at this source revision.
Desktop dark appearance and compact single-update indicator
Expanded update list — dark appearance (01:10:02).
Compact state — one available update (01:15:15).
Review fixes
Addressed the September 19 review:
The independent follow-up review found no remaining issues in the four lifecycle fixes:
Also explicitly release Unix instance locks when their owner drops, even if a subprocess still holds an inherited descriptor. A deterministic duplicate-descriptor regression covers the failure observed in session-sync CI. The shell fallback fixture now includes
/usr/bin, where macOS providesenv.Validation
Current head:
15af555a.Rebased onto
mainatbbf590c8. GitHub reports no merge conflicts after the rebase.git diff --checkpassed. Workspace formatting still reports unrelated existing drift.Desktop screenshots in this description remain historical. Stills do not establish animation smoothness or live updater success. Other device sizes, RTL, and accessibility text sizes remain unverified in this iteration.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.