Skip to content

Support update-all and update-manager in headless sessions - #5609

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
mainfrom
claude/headless-update-all-cli-71403d
Oct 27, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
mainfrom
claude/headless-update-all-cli-71403d

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Summary

package update-all and package update-manager only worked when the desktop window was open: the IPC server relied on the window's OnUpgradeAll / OnUpgradeAllForManager events, so a --headless session answered "The current UniGetUI session cannot update all packages."

  • The two events are replaced by IpcServer.UpdateAllHandler, which returns the operations it queued. The desktop app still queues updates through its window, so they show in its operations list.
  • Without a handler (headless), the server queues the updates itself through IpcPackageApi.QueueAllUpdatesAsync. It reads only the update loader's list, never the managers' raw lists, so ignored updates, skipped minor updates and the minimum update age still apply. Packages that already have an update queued or running are skipped.
  • Both modes return an IpcPackageBulkOperationResult listing the queued operation ids, which operation wait can follow.
  • CLI: update-all accepts --manager, and both commands accept --wait true, --timeout (default 3600) and --delay. The wait runs in the CLI, which polls the operations list, so it isn't bound by the 5-minute request timeout. It exits with 1 if any update fails or the wait times out. Note that a failed single package update still exits 0; the non-zero exit is new and limited to --wait.
  • An unknown --manager is now rejected with HTTP 400 instead of silently queueing nothing.
  • docs/CLI.md and docs/IPC.md are updated, including a new "Updating everything" section.

Testing

  • dotnet test on the IPC tests: 56 passed, including 7 new ones in IpcBulkUpdateTests (CLI parsing, JSON source-gen round trip, queued result shape, wait result mapping).
  • Started a real --headless daemon over TCP and ran package update-manager --manager bun (disabled there, so nothing could be installed) with and without --wait true: queuedCount: 0, exit code 0. An unknown manager returned a clear error with exit code 2. A real update-all was not run, to avoid updating software on the test machine.
  • dotnet format whitespace --verify-no-changes passes. dotnet format style --verify-no-changes reports only an existing IDE0060 in CargoManagedOperationRoutingTests.cs, which this PR doesn't touch.
  • NativeAOT publish was not run. The new payload type is registered in IpcJsonContext, and no reflection is added.

🤖 Generated with Claude Code

Only the desktop window handled these commands, so a --headless session
rejected them. The server now asks the host for the operations it
queued and, without a window, queues the updates itself from the
update list (so ignored updates, skipped minor updates and the minimum
update age still apply). Both modes return the queued operation ids.

The CLI gains --manager on update-all, plus --wait, --timeout and
--delay, which poll the queued operations and exit with 1 if any did
not succeed or the wait timed out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The E2E still expected both commands to fail headless. Run them with
--wait true, scoped to the manifest's update-manager and update-all
fixture managers, since an unscoped update-all would update whatever
the runner image has installed. Also check that an unknown manager is
rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit 1badf37 into main Oct 27, 2026
5 checks passed
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) deleted the claude/headless-update-all-cli-71403d branch October 27, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant