multica/server/internal/handler
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.go feat(upload): signed URLs for CLI + eager load attachments on comments 2026-03-31 15:42:10 +08:00
activity_test.go feat(activity): unified activity timeline with comment reply support 2026-03-28 21:53:08 +08:00
agent.go fix(agent): revise agent permission model for visibility and mentions 2026-04-02 12:45:31 +08:00
auth.go feat(upload): add file upload API with S3 + CloudFront signed cookies 2026-03-31 14:41:17 +08:00
comment.go feat(mentions): support @mentioning issues + server-side auto-expansion (#242) 2026-04-02 13:48:53 +08:00
daemon.go feat(runtime): support CLI update from web runtime page (#331) 2026-04-02 14:12:49 +08:00
file.go fix(upload): remove file type allowlist to support all file types (#329) 2026-04-02 13:55:50 +08:00
handler.go feat(runtime): support CLI update from web runtime page (#331) 2026-04-02 14:12:49 +08:00
handler_test.go fix(auth): enforce auth on daemon API routes (#224) 2026-03-31 16:13:58 +08:00
inbox.go fix(inbox): remove hardcoded 50-item limit from inbox list query 2026-03-31 18:36:41 +08:00
issue.go Merge pull request #306 from multica-ai/agent/lambda/832eb090 2026-04-01 22:28:52 +08:00
issue_reaction.go feat(reactions): add emoji reactions for comments and issue descriptions 2026-03-30 22:37:59 +08:00
personal_access_token.go feat(auth): email verification login and personal access tokens 2026-03-26 14:32:30 +08:00
reaction.go feat(reactions): add emoji reactions for comments and issue descriptions 2026-03-30 22:37:59 +08:00
runtime.go refactor(server): consolidate workspace permission checks into middleware 2026-03-30 03:40:20 +08:00
runtime_ping.go feat(runtimes): add Runtimes tab with usage tracking and connection test 2026-03-26 18:28:36 +08:00
runtime_update.go feat(runtime): support CLI update from web runtime page (#331) 2026-04-02 14:12:49 +08:00
skill.go fix(agent): allow members to manage skills on their own agents 2026-04-02 12:25:19 +08:00
subscriber.go feat(api): strict workspace isolation + agent parity fixes 2026-03-30 16:49:13 +08:00
subscriber_test.go feat(notifications): replace hardcoded inbox notifications with subscriber-driven model 2026-03-28 19:33:20 +08:00
trigger_test.go fix(server): @all mentions should not trigger agent execution 2026-04-02 00:33:21 +08:00
workspace.go refactor(server): consolidate workspace permission checks into middleware 2026-03-30 03:40:20 +08:00