User clarified the actual product vision: autopilot is a TRUST LADDER,
not a config screen. Five levels, each adding one more thing Cockpit
decides on your behalf. The middle level (Beacon — popup + countdown
auto-pick) was orphaned by commit 848da6c "stop hook calls strategist
(no more popup race)" — that swap traded the popup race for a
loose-cannon strategist that fired AI-composed prompts without consent.
Bringing the popup back, without the old race (KDE D-Bus + Chrome
+ /tmp polling), since the SSE-driven Chromium window already
replaced the old multi-layer setup.
The five-level ladder, marketing-clear:
L1 Manual — only what you type (Free tier)
L2 Queue — drains your queue (Free tier)
L3 Beacon — popup + countdown (Pro $20/mo) ← new default
L4 Continuous — auto-fires next-best (Pro $20/mo)
L5 Mission — Groq composes from
mission/goals/roadmap (Mission $50/mo)
Concrete changes this commit:
- src/config/beacon.ts: AUTO_INJECT_MODE_VALUES gains "beacon" (the
popup level). All five values have user-facing labels Manual / Queue
/ Beacon / Continuous / Mission with description lines that name the
level number and the sales-grade one-line pitch.
- src/lib/constants/control.ts: DEFAULT_AUTO_INJECT_MODE flips from
"strategist" (L5) to "beacon" (L3). New users start at the right
trust level — Cockpit shows them every dispatch through a popup
with countdown auto-pick, so they earn confidence in the system
before opting into Continuous or Mission.
- scripts/agent-hook-bridge.sh:
• autopilot_dispatch_and_inject() gains a new branch for
mode="beacon": calls ./beacon.py stop $tab $session_file, captures
the user's choice (or countdown auto-pick) on stdout, then
dispatches via emit_or_inject_prompt with the chosen prompt key.
Custom prompts come back as "__custom__<body>".
• Bash defaults for _BEACON_AUTO_MODE change from "strategist" →
"beacon" in both the API-fetch path and the Python-config
fallback path, so a fresh install with no settings row lands at
L3, not L5.
- src/components/control/AutomationPolicyControl.tsx: MODE_STYLE record
gains the "beacon" case (cyan-dot, pulsing). Tooltips for all five
cases rewritten with the level number + the one-line pitch so
hovering the pill teaches the trust ladder.
- src/components/control/ControlFleetStatus.tsx: AUTOMATION_HINT
record gains the "beacon" case. Hints under the fleet chips now
describe the level in plain English (was: jargon like "strategist
composes context-aware prompts" → now: "Mission — Cockpit composes
context-aware prompts from project mission, goals, and history").
Note: the existing "strategist" code value is preserved as the L5
storage key. Mission as a customer-grade feature still needs the
work tracked in roadmap "## Proposed": project context loader,
quality gate, audit trail, sleep budget, trust score. Today's commit
is just the ladder + the missing beacon wire.
beacon.py itself was already installed at
~/.local/share/cockpit-beacon/beacon.py (orphaned since 848da6c);
this commit puts it back in the call path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cockpit's promise is autopilot — agents keep working when you're away.
The "queue_only" default introduced 2026-05-25 silenced the strategist on
day one, leaving new users in a non-autopilot product. Safety rails are
already in /api/control/dispatch (manual override, health gate, hard_stop,
queue priority) and the Stop hook respects them; the day-one risk that
prompted the flip no longer applies after /control became trustworthy in
6da8d7e + 7d7c40a.
Centralizes the default in DEFAULT_AUTO_INJECT_MODE (src/lib/constants/
control.ts) so the schema, queries, Settings UI, and Python/shell fallbacks
all source one constant. Adds an inline self-test (test:autopilot-defaults)
that pins every fallback to the autopilot value, wired into pre-push.
Existing users keep their explicit choice — only NEW rows get strategist.
The Drizzle migration is idempotent and reaffirms the column default.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Web popup at /beacon/live is the sole popup surface. Deletes the dead
PyQt vendored modules, the foreign-UI zenity/kdialog/notify-send dialog
that asked the user whether to start Cockpit, and the PyQt-import gates
in the install/smoke/runtime check scripts. The session JSON is now
written unconditionally; if Cockpit is unreachable, beacon.py
fire-and-forgets `systemctl --user start cockpit-app` and exits — the
session surfaces via SSE once the service is up.
Also fixes a pre-existing react-hooks/purity error in StuckGoalsCard
(impure Date.now() inside server component body) that was blocking the
pre-commit lint hook for the whole repo.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Moves beacon settings from a shared machine file to a per-user `beacon_settings`
Postgres table so every account has independent control. Adds `popup_mode` (web /
pyqt / both / disabled) with pros/cons shown in the settings UI.
- New `beacon_settings` table (userId unique FK, all existing fields + popup_mode)
- `db/queries/beacon-settings.ts` — getBeaconSettings / upsertBeaconSettings
- GET /api/beacon-settings now requires auth; both verbs read/write DB
- beacon.py reads popup_mode via get_popup_mode() and gates PyQt / web accordingly
- _beacon_config.load_settings() fetches from API with 5-min /tmp cache, falls back
to legacy file when Cockpit is offline
- agent-hook-bridge.sh fetches settings via Bearer token; exports BEACON_POPUP_MODE;
both stop and notification handlers gate immediately on popup_mode=disabled
- Settings page: 4-card popup mode selector with per-option pros/cons descriptions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hardcoded 60s idle threshold with min_idle_seconds setting.
Default is 0 which fires the popup every session end regardless of
keyboard activity. Setting lives in beacon.json, surfaced in Settings UI.
Both the stop-hook beacon and the notification auto-inject respect it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
beacon.py writes sessions directly to /tmp when Cockpit is running locally,
bypassing the TypeScript API. It hardcoded nextAgent: null and
capacityIssue: false, silently breaking the auto-switch-on-capacity-issue
flow that the user specifically asked for.
Add looks_like_capacity_issue() and resolve_next_agent() to _beacon_config.py
as Python mirrors of the TypeScript equivalents in src/lib/agent-registry.ts,
and wire them into _write_beacon_session(). The "capacity issue" banner and
auto-continue switch now fire correctly in the local path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- _beacon_config.py: add read_project_git_branch() (mirrors server-side parseProjectsConf logic)
- beacon.py: embed gitBranch in session JSON at write time so SSE/web consumers get it without a server-side lookup
- _beacon_popups.py: rewrite ContinuePopup header — green dot, project name, "Ready" badge, then chips row with agent chip + git branch chip; matches web beacon header exactly
- sse/route.ts: add git branch fallback enrichment for sessions written before this change
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SWITCH_CHOICE_PREFIX="switch:" was defined locally in beacon/[id]/page.tsx
(TypeScript) and _beacon_popups.py (Python), while its sibling CUSTOM_CHOICE_PREFIX
already lived in src/lib/constants/control.ts and _beacon_config.py respectively.
- Add SWITCH_CHOICE_PREFIX to constants/control.ts alongside CUSTOM_CHOICE_PREFIX
- Remove local const from beacon/[id]/page.tsx; import from constants instead
- Move SWITCH_CHOICE_PREFIX from _beacon_popups.py into _beacon_config.py; import it
- Update shell script comment to cover both prefixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- _beacon_theme.py — color palettes + theme loading (no PyQt)
- _beacon_config.py — runtime constants + settings helpers (no PyQt)
- _beacon_audio.py — WhisperThread speech-to-text
- _beacon_popups.py — Qt stylesheet, all widget classes
- beacon.py — thin 198-line entry point
Also fix inject_prompt in agent-hook-lib.sh: add || true to zellij
commands so set -euo pipefail doesn't abort before Enter is pressed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>