Skip to content

fix(agent): allow a remote update when the offer is not downloaded yet - #1424

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-rupd-remote-download
Nov 2, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-rupd-remote-download

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A paired computer whose verified update was Available (offered, not yet downloaded) showed "A verified update is not ready on this computer." and a disabled Update remotely… button. The client/remote version difference was never the block; every layer (Controller::remote_status, the client's install_blocked, the controller's re-probe, host admission and the desktop's may_begin) required the execution computer's updater to be Ready.

Now an unblocked Available offer can be requested:

  • Execution desktop (desktop/remote_updates.rs, update.rs): may_begin returns Install (Ready, unchanged path), Download (Available, not manual-only) or Refuse. For Download, Controller::download_remote downloads and verifies exactly the requested candidate through the ordinary updater (download_inner: signed envelope, package staging), while this computer keeps working. Nothing is closing and no restart prompt is shown yet. Only a Ready snapshot for the same ReleaseIdentity continues. The desktop then publishes that status on the command's own lease and checks admission again (account, store, quitting, local restart prompt). After that it takes the existing stop-and-install path, which revalidates the feed and keeps every typed-stop check.
  • Failed download: the prior Available snapshot is restored, so there is no local error banner and the offer stays retryable (the finding-4 lesson from Agent: add experimental remote update controls #1256). The receipt records a controlled message, "This computer could not download or verify the update. Nothing was installed." The host accepts that one string verbatim and still replaces any other desktop error with the generic text.
  • Host admission (remote_updates.rs): requests admit an unblocked Ready or Available offer with the exact target (admits_request). The typed stop (authorize_stop) still requires a published Ready/Installing offer. That is why the desktop publishes after the download. Publications now read the updater snapshot after taking the registration lock, so an older snapshot cannot overwrite a newer one.
  • Capability: hosts advertise remote_update_download_v1. PROTOCOL_VERSION stays 7.1.0, following Agent: summarize tool calls as they start #1261 (tool_summary_start_v1): capabilities, not minors, gate behaviour.
  • Older hosts (0.0.16 and earlier) report Available as UpdateNotReady. The controller still lets you ask (PeerInfo::install_requestable). The old host refuses in its broker before creating a receipt, so nothing is queued, stopped or left stuck. The controller maps that refusal to InstallRefusal::DownloadRequired: "That computer must download the update first. Turn on automatic downloads there, or update it locally." A new status check is required before asking again, the same as for every other declined request.

Unchanged: exact candidate binding at every hop, no replay, fail-closed revalidation, refusal for password-protected computers, receipts, and the confirmation dialog.

Screenshots

These come from a local-only preview build with mocked PeerInfo (no real update feed in Dev builds). The preview hook is not committed.

Before (master): Available, button disabled
before

After: Available, Update remotely… enabled
after

Older host asked anyway: short, definite refusal (the reply is simulated in the preview; the mapping is remote/manager.rs)
older host

Tests

  • just ci (fmt, clippy -D warnings for every feature set, workspace tests, headless tests): green. The pre-commit hook (ci-lint + ci-test) also passed.
  • New tests:
    • update::tests::remote_download_prepares_only_the_exact_available_candidate
    • failed_remote_download_restores_the_retryable_offer_without_a_local_error
    • remote_download_refuses_changed_busy_or_manual_offers_without_downloading
    • desktop::remote_updates::tests::an_available_offer_is_downloaded_before_anything_is_stopped
    • a_failed_download_reports_its_controlled_reason_once
    • the_downloaded_offer_is_published_only_on_the_commands_own_lease
    • remote_updates::tests::requests_admit_only_the_exact_unblocked_ready_or_available_offer
    • a_failed_remote_download_is_recorded_without_arbitrary_desktop_errors
    • remote::update::tests::available_offers_are_requestable_from_download_capable_and_older_hosts
    • ui::remote::tests::an_available_offer_can_be_requested_without_downloading_it_first
    • update_button_is_enabled_for_an_available_offer_on_new_and_older_hosts
    • an_older_hosts_download_refusal_is_definite_and_short

Not verified

  • A real signed download and install between two packaged Prod builds. Dev builds have no update feed, so the download path is covered only by unit tests with an injected download step.
  • The real 0.0.14/0.0.16 host refusal over the wire. Its broker code was checked at 324fc47c (lease.status.state != Ready → "no longer ready"), and the client mapping is unit-tested.

🤖 Generated with Claude Code

@AnthonyRonning AnthonyRonning changed the title codex rupd remote download fix(agent): allow a remote update when the offer is not downloaded yet Nov 2, 2026
A paired computer whose verified update was Available but not yet
downloaded showed "A verified update is not ready" and a disabled
"Update remotely…" button. The version difference was never the block:
every layer required the execution computer's updater to be Ready.

Now an unblocked Available offer can be requested. The execution desktop
downloads and verifies that exact candidate through its ordinary updater
before it stops anything, publishes the resulting Ready status on the
command's own lease, checks admission again, and only then takes the
existing stop-and-install path. A failed download restores the Available
offer (no local error banner, retry stays possible) and records a
controlled "could not download or verify" receipt.

Hosts advertise remote_update_download_v1. Older hosts (0.0.16 and
earlier) report Available as not ready; the controller still asks them,
they refuse before admitting any work, and the controller says the update
must be downloaded on that computer first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning force-pushed the codex-rupd-remote-download branch from b205452 to ddad97c Compare November 2, 2026 01:48
@AnthonyRonning
AnthonyRonning marked this pull request as ready for review November 2, 2026 04:00
@AnthonyRonning
AnthonyRonning merged commit 451e754 into master Nov 2, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-rupd-remote-download branch November 2, 2026 04:00
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