feat: start-at-login is a Settings switch, off by default (v2.5.0)

- Settings → About → "Start AgentHub automatically" (AutostartSettings.tsx,
  GET/PUT /api/settings/autostart, server/lib/autostart.js). The switch is
  the systemd --user unit's / LaunchAgent's enabled state: on writes a unit
  for the running server when none exists and enables it, off disables it;
  neither starts or stops the server. A foreign unit is never touched
  (409 EFOREIGN)
- The plugin bootstrap no longer installs a unit on every install: it
  installs or starts one only while the user has it enabled, and a rewrite
  keeps the enabled state (writeUserService({ enable })). An install that
  already had the unit enabled stays on. A stale-but-enabled unit beside a
  live detached server is repointed, no longer started onto the bound port
- unitIsEnabled / setUnitEnabled in systemd-service.js and launchd-service.js

Also:
- fix(workspace): status bar no longer covers the chat box below md (#61)
This commit is contained in:
2026-10-06 18:53:10 +07:00
parent 4aae61297f
commit 03ecc9e29a
25 changed files with 620 additions and 36 deletions
+83 -1
View File
@@ -3,7 +3,7 @@
openapi: 3.0.3
info:
title: Agent Dashboard for Claude Code API
version: 2.4.0
version: 2.5.0
description: HTTP API for real-time Claude Code session monitoring, agent lifecycle tracking, analytics, pricing, hooks ingestion, and workflow intelligence.
contact:
name: Nguyễn Ngọc Trí Vĩ
@@ -12585,6 +12585,88 @@ paths:
results:
- id: src_a
ok: true
/api/settings/autostart:
get:
tags:
- Settings
summary: Whether the dashboard starts at boot/login
description: The per-user service's enabled state (a systemd `--user` unit, or a LaunchAgent on macOS). Off by default.
operationId: getAutostart
responses:
'200':
description: Start-at-login state
content:
application/json:
schema:
type: object
required:
- available
- kind
- enabled
- foreign
properties:
available:
type: boolean
description: False with no systemd --user (Linux) or GUI login (macOS)
kind:
type: string
enum:
- systemd
- launchd
enabled:
type: boolean
foreign:
type: boolean
description: A unit named agenthub exists that AgentHub did not write
put:
tags:
- Settings
summary: Turn start-at-login on or off
description: Enables or disables the unit, writing one for the running server first when none exists. Never starts or stops the server. Same-origin only.
operationId: setAutostart
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- enabled
properties:
enabled:
type: boolean
responses:
'200':
description: The new state
content:
application/json:
schema:
type: object
required:
- available
- kind
- enabled
- foreign
properties:
available:
type: boolean
description: False with no systemd --user (Linux) or GUI login (macOS)
kind:
type: string
enum:
- systemd
- launchd
enabled:
type: boolean
foreign:
type: boolean
description: A unit named agenthub exists that AgentHub did not write
'400':
description: 'EBADVALUE: `enabled` is not a boolean; EUNAVAILABLE: no systemd --user / launchd GUI session'
'403':
description: 'EBADORIGIN: another site asked'
'409':
description: 'EFOREIGN: a unit named agenthub that AgentHub did not write'
/api/settings/codex-hooks:
get:
tags: