multica/server/cmd/server
LinYushen fdba410f11
feat(runtime): support CLI update from web runtime page (#331)
* feat(runtime): support CLI update from web runtime page

Add the ability to update the CLI daemon from the web Runtime detail page.
When a newer version is available on GitHub Releases, an update button
appears. Clicking it sends an update command through the server to the
daemon via the heartbeat mechanism (same pattern as ping). The daemon
executes `brew upgrade`, reports the result, and restarts itself with the
new binary.

Changes across all three layers:
- Frontend: version display, GitHub latest check, UpdateSection component
- Server: UpdateStore (in-memory), heartbeat extension, 3 new endpoints
- CLI: shared update logic, daemon handleUpdate + graceful restart

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(runtime): handle 'running' status in ReportUpdateResult

The daemon sends {"status":"running"} when it starts executing the
update, but ReportUpdateResult treated any non-"completed" status as
failure — immediately marking the update as failed before brew upgrade
even ran.

Fix: use a switch statement to handle "running" as a no-op (status is
already "running" from PopPending), and also timeout running updates
after 120 seconds in case brew upgrade hangs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:12:49 +08:00
..
activity_listeners.go feat(realtime): WS invalidation + refetch pattern, inbox bugfixes, UI polish 2026-03-29 13:49:40 +08:00
activity_listeners_test.go feat(realtime): WS invalidation + refetch pattern, inbox bugfixes, UI polish 2026-03-29 13:49:40 +08:00
comment_trigger_integration_test.go fix(server): @all mentions should not trigger agent execution 2026-04-02 00:33:21 +08:00
integration_test.go feat(auth): email verification login and personal access tokens 2026-03-26 14:32:30 +08:00
listeners.go feat(realtime): skip WS refetch for self-triggered events 2026-03-31 13:09:17 +08:00
main.go fix(runtime): add server-side sweeper to detect stale runtimes 2026-03-29 14:22:12 +08:00
notification_listeners.go feat(mentions): support @mentioning issues + server-side auto-expansion (#242) 2026-04-02 13:48:53 +08:00
notification_listeners_test.go fix(inbox): remove hardcoded 50-item limit from inbox list query 2026-03-31 18:36:41 +08:00
router.go feat(runtime): support CLI update from web runtime page (#331) 2026-04-02 14:12:49 +08:00
runtime_sweeper.go fix(server): broadcast sweeper task:failed events to correct workspace 2026-04-02 03:20:59 +08:00
runtime_sweeper_test.go test(server): add integration tests for sweeper event broadcasting fix 2026-04-02 03:30:32 +08:00
subscriber_listeners.go fix(server): subscribe @mentioned users in issue descriptions 2026-03-31 18:36:15 +08:00
subscriber_listeners_test.go feat(notifications): replace hardcoded inbox notifications with subscriber-driven model 2026-03-28 19:33:20 +08:00