The Notification hook was unconditionally injecting "Resolve the pending
question..." whenever Claude Code sent a notification event — even if the
user was actively at the keyboard typing their own reply. This caused the
double-prompt problem independently of the Stop hook fix.
Two changes:
1. handle_notification now applies the same 60s idle gate as handle_stop.
If the user is active, the hook plays the attention sound only and exits —
the user responds themselves. Auto-inject only fires when they're away.
2. The "continue" prompt entry in agent-prompts.json had style "internal"
and slot null, making it invisible in the prompt library UI despite being
the SSOT for this behavior. Changed to style "more" / slot 14 so it
appears under the More button and can be read, used, and edited from the
same place as every other prompt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Layer 1 (< 100ms): notify-choice.py shows a native KDE notification with
action buttons built from the first 3 prompt slots. Uses gi.repository.Notify
+ GLib event loop so actions are properly wired (plain notify-send --action
is not supported by the KDE notification server). When clicked:
- prints the slot number (choice)
- patches /tmp/cockpit-beacon/{id}.json so the browser beacon sees
choice != null and window.close()s itself within 500ms
Layer 2 (1-4s): beacon_python opens the full browser beacon in parallel.
Both layers write to a shared tempfile via atomic mv — first write wins.
The main loop polls every 200ms, kills both processes on first result.
If neither layer produces a choice (user is at keyboard, typing manually),
the hook exits cleanly without injecting anything.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two fixes to make the beacon popup work without requiring the browser to
be logged into Cockpit:
1. Server-side initial session read — page.tsx is now a Server Component
that reads the beacon session directly from /tmp/cockpit-beacon/{id}.json
before sending HTML to the browser. The client receives a fully-populated
initialSession prop and shows session content immediately — no client-side
GET /api/beacon/{id} needed on page load. The PATCH (recording the user's
choice) and the cancel-detection poll still go through the API, which
works as long as the browser that opens the popup has a Cockpit session.
2. Prefer Brave browser for the popup — beacon.py now checks for brave-browser
before google-chrome in the candidate list. The user's Cockpit session
lives in Brave (the primary browser), so opening there means API calls
from the beacon page are authenticated automatically.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The XScreenSaver extension is unavailable on this machine's X11 display.
Add /dev/pts youngest-atime as a fallback: the most recently accessed
pseudo-terminal is a reliable proxy for 'user is active in a terminal'
and needs no extra packages or group membership.
Detection order: libXss (XScreenSaver) → /dev/pts atime → 9999 (show beacon).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three targeted fixes for the "prompt injection even when at keyboard" problem:
1. Remove the `choice="1"` fallback — when the beacon times out or Chrome fails
to open, the hook now exits cleanly instead of auto-injecting slot 1 on top of
whatever the user typed manually.
2. X11 idle gate — skip beacon entirely when the user has been active within the
last 60 s (uses xprintidle if installed, falls back to libXss via ctypes, falls
back to 9999 = always show beacon when neither is available). Install
xprintidle with `sudo apt install xprintidle` to enable on systems without the
MIT-SCREEN-SAVER X11 extension.
3. Instant notify-send notification fires before Chrome launches so the user gets
immediate visual feedback while the browser beacon popup loads (1–4 s on first
Chrome launch, near-instant when Chrome is already running).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
beacon.py now writes sessions to /tmp/cockpit-beacon/{uuid}.json
directly instead of POSTing to /api/beacon, and polls the file instead
of GET /api/beacon/{id}. No API auth is needed — the browser popup (which
has the user's session cookie) still calls the API to load the beacon UI
and write the choice. Works immediately without any dev server restart.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs preventing the popup from working:
1. /api/beacon was matched by the auth middleware (401 for unauthenticated
beacon.py). Added api/beacon to the middleware exclusion list — sessions
are /tmp UUIDs with no sensitive data.
2. FocusCancelTextEdit(QPlainTextEdit) called setAcceptRichText which does
not exist on QPlainTextEdit (it's a QTextEdit method). Removed the
redundant call — QPlainTextEdit is plain-text-only by definition.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Browser popup (Chrome --app= frameless window) is now the default when
Cockpit is running. PyQt native widget is used only when no browser is
found or Cockpit is not running. The confirm dialog still uses PyQt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- stripe/portal: remove copy-paste duplicate if (!userId) guard (dead code)
- money page: remove hardcoded Apr 2026 verification date that was already
stale and would keep rotting; label remains without the date
- smoke.sh: add /api/setup (public), /api/checkout/personal, and
/api/stripe/portal (accepts 401 + 503 when Stripe not configured);
extend check_route with extra_ok_code param for integration-gated routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added /api/health (public), /api/control/agent, /api/control/commands,
/api/captures, and /api/beacon-settings to smoke coverage. All return
expected status codes (200 for public, 401 for auth-required routes).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PAGE_ROUTES was missing /history, /thoughts, /settings (all in
NAV_ITEMS per the comment's own rule) and /whitepaper (public page).
Routes match navigation.ts NAV_ITEMS order for easier diffing.
AUTH_API_ROUTES grows from 5 to 10 — adds /api/me, /api/user-projects,
/api/invitations, /api/sessions, /api/prompts/agent. Each confirmed to
have a GET handler before adding. /api/subscriptions omitted (POST-only).
All 28 routes verified green against the running dev server.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
smoke.sh was always exiting 1 because auth-required API routes correctly
return 401 without a session — but the script treated anything ≥400 as a
failure. Splits routes into PUBLIC_API_ROUTES (must 2xx) and AUTH_API_ROUTES
(200 or 401 both pass), so the check meaningfully detects 500s without
requiring a live session. When COCKPIT_SESSION_TOKEN is set, all requests
are authenticated and the full DB/query layer is exercised (20/20 routes).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the should_skip_native_popup() function and its call site from
agent-hook-bridge.sh — prefer_browser_ready_ui was removed from the UI
and API, leaving this code checking a setting that no longer exists.
Fixes a repeated-install bug in install-cockpit-app.sh where cp -r into
an existing directory nests the source as a subdirectory instead of
overwriting. Now removes target dirs before copying.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the local Next.js app (cockpit-app.service) is running, the daemon
now routes all runtime-state pushes and command polls to localhost:3000
instead of cockpitapp.vercel.app. This makes the Control panel on the
local machine show live agent state (via local PostgreSQL) rather than
always showing idle.
Detection logic:
- At startup: probe localhost:3000/api/health up to 8 times (1 s apart)
so the daemon doesn't race past the app during boot.
- During operation: re-check every 30 s via a shared tmpfile cache so
both the poll loop and the background push loop agree on the URL.
- Falls back to COCKPIT_BASE_URL (Vercel) when localhost is unreachable.
Updated cockpit-daemon.service to soft-depend on cockpit-app.service
(Wants= / After=) so systemd starts the app before the daemon.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two scripts to run Cockpit locally as a production-grade service
instead of relying on `npm run dev`:
- scripts/cockpit-app.sh: wrapper that sources .env.local and launches
the Next.js standalone server at localhost:3000. Unsets the bash
HOSTNAME builtin so the server binds to 0.0.0.0 (not the machine's
hostname which resolves to 127.0.1.1).
- scripts/install-cockpit-app.sh: one-shot installer that builds the
production bundle, copies static assets into .next/standalone, writes
~/.config/systemd/user/cockpit-app.service, and enables + starts it.
Accepts --skip-build to reinstall without rebuilding.
Run: npm run install-app (or npm run build && npm run install-app --skip-build)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ContinuePopup._build_summary used C['input_bg'] but neither palette
defined it, causing a KeyError crash on every stop hook — popup fell
back to slot-1 auto-continue silently instead of showing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cockpit Beacon can now be installed independently of the Next.js web app.
The popup (PyQt6 session-stop overlay + queue + prompt dispatch) works
without a running Cockpit server — web sync is an optional enhancement.
Changes:
- scripts/install-beacon.sh — new installer
Copies beacon scripts to ~/.local/share/cockpit-beacon/
Wires ~/.claude/hooks/stop.sh and notification.sh (backs up existing)
Creates ~/.config/agent-prompts.json with a working default prompt set
Creates ~/.config/agent-projects.conf with format instructions
Checks for PyQt6, jq, zellij, xrandr and prints targeted install hints
- scripts/agent-hook-bridge.sh — PyQt6 detection order fixed
beacon_python() now prefers system PyQt6 (pip install PyQt6 or
apt install python3-pyqt6) and falls back to the .python-vendor
bundle only when system install is absent — making standalone use
work without the Cockpit repo on disk
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- beacon.py: PyQt opens immediately; web session only created when Cockpit
is already running (2s check). Eliminates 1-3s startup delay. Web poll
runs in daemon thread every 3s to sync control-panel choice back to popup.
- _beacon_popups.py: queue section always visible with hint text when
empty ("Alt+Enter to add · runs automatically when session ends").
Adds collapsible "Recent" section showing last 5 dispatched custom prompts,
stored in ~/.local/share/cockpit/prompt-history.json. Clicking a recent
item fills the custom input for editing before send.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cloud mode queues inject commands with prompt=promptKey (the raw key string)
because the full text isn't available server-side. The daemon now reads
promptKey from the payload and calls _resolve_prompt(), which looks up the
prompt text via get_prompt() from agent-prompts.json and wraps it with
session context (mirroring buildPromptWithSession in TypeScript), so the
correct expanded prompt is injected into the Zellij tab instead of the
literal key name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
switch-agent route returned 503 in cloud mode. Now enqueues a
switch_agent pending command instead, which the local daemon claims
within its 5s poll cycle and executes:
1. injects the quit command for the current agent (e.g. /exit for claude)
2. waits 1s for exit, then injects the launch command for the new agent
Schema: adds SwitchAgentPayload type and "switch_agent" to the type comment.
Queries: adds enqueueSwitchAgentCommand.
Daemon: adds execute_switch_agent + _agent_quit_cmd + _agent_launch_cmd
helpers; adds switch_agent case to the main dispatch loop.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Daemon now detects whether each project's Zellij tab is actually open
and pushes tabOpen:boolean with every runtime state heartbeat.
Control panel on Vercel reads this from project_states instead of
calling getZellijTabs() locally — fixes the always-closed tab display
in cloud mode.
Beacon transcribe falls back to pending_commands queue when runtime is
unavailable (Vercel), so voice commands relay to local Whisper daemon.
Command results now carry a text field for transcription payloads.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without ZELLIJ_SESSION_NAME set, `zellij action` outside a session lists
sessions instead of targeting one, so write-chars fired nowhere despite
returning 0. Now `_find_session_for_tab` scans all sessions via
query-tab-names to find the right one, then prefixes every action with
ZELLIJ_SESSION_NAME. Also removes expandedCount from the OPEN TABS
metric card — UI expansion state doesn't belong in a Zellij-backed
tab count.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Queued (remote) injects bypassed the typing guard and could garble input
the user was actively composing in Zellij. Daemon now checks the same
/tmp/cockpit-typing-* marker files the API route uses, waiting up to 30s
for the user to finish before firing — and skipping if they're still typing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds isUserTypingInTab() that reads /tmp/cockpit-typing-<PANE_ID> marker
files written by ZSH zle hooks. The inject route returns
{ ok: true, blocked: true, reason: "user-typing" } instead of firing
write-chars into a tab where the user is mid-keystroke.
Includes scripts/install-cockpit-hooks.sh for one-shot ~/.zshrc setup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add agentRunning, activeAgents, lockAt columns to project_states schema
- New POST /api/control/runtime-state endpoint (daemon bearer auth)
accepts per-project runtime patches and upserts to DB
- control/route.ts: use DB agentRunning/activeAgents/currentPrompt
when isRuntimeAvailable()=false (Vercel sees live fleet state)
- stream/route.ts: DB polling path when !isRuntimeAvailable()
maps project_states rows → FastProjectState for SSE clients
- cockpit-daemon.sh: _push_loop runs in background every 2s,
reads /proc + /tmp sentinels + current-prompt files and pushes
all 7 tab states to the new endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cross-reference comments point bash defaults to AGENT_DEFAULT_MODELS in
agent-registry.ts so the coupling is visible without runtime import.
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>
Migrates all 15 user-data tables from local Postgres to Neon, rewriting
the default user_id (00000000-...) to the GitHub OAuth user_id. Uses
COPY format (binary-safe, no quoting issues) and imports in FK dependency
order. Re-runnable: skips already-populated tables unless --force is passed.
Result: 1324 entities, 2315 interactions, 20 projects, 638 orchestration
events, and all other data now live in Neon — deployed Cockpit now shows
the same data as localhost.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deployment-specific URLs expire; the stable alias cockpit-orangecat.vercel.app always resolves to production.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The daemon token authenticates the machine; the server finds the default
user automatically. Removes COCKPIT_DAEMON_USER_ID requirement so the
daemon works before the operator knows the Neon-assigned UUID.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the missing link between cloud dispatch and local execution:
- GET /api/control/commands — claim next pending command (daemon auth via bearer token)
- PATCH /api/control/commands/[id] — mark command executed with result
- scripts/cockpit-daemon.sh — polls Vercel every 5s, executes inject/focus_tab via zellij
The daemon authenticates with COCKPIT_DAEMON_TOKEN. COCKPIT_DAEMON_USER_ID lets it
claim commands without a session cookie so it can run headlessly as a background service.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously the PyQt popup always started with auto-continue ON, ignoring
any pause set in the web control panel (only mattered when Cockpit was
down at popup-open time).
Fix: write/delete /tmp/cockpit-auto-continue-<tab> whenever the web app
toggles or resets auto-continue state (new API route). PyQt reads the
sentinel on init and skips starting the countdown when paused.
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>
Bash was writing identical /tmp sentinel files under both naming schemes
simultaneously (agent-ready-{tab} AND claude-ready-{tab}) and TypeScript
was reading with double-fallback (?? stateFile.claudeReady) logic.
Now:
- Bash stop handler writes only agent-* sentinels (new canonical names)
- Dual-delete lines kept so stale claude-* files on disk are still cleaned up
- TypeScript reads only agent-* (no ?? fallback); 4 dead stateFile.claude*
helpers removed (claudeClosing, claudeSentinel, claudePrompt, claudeLock)
- claudeReady + claudeClosed kept for the cleanup unlinkSync calls in
inject/orchestration routes
- notification handler simplified: single-name checks, 6 dead lines removed
- agent-config.ts comment updated to "legacy names — cleanup only"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
control-fast-state.ts had a single-line regex parser; sessions/route.ts had a
more capable multi-line buffering parser that stops at ## sections. Both parsed
the same on-disk handoff format (done/next/tests/todos/health).
Add parseSessionFile(raw) to session-content.ts — the canonical implementation
using the multi-line algorithm. Both callers now import it; the local parse
functions are deleted. control-fast-state.ts shrinks from 17 lines to 5.
The Python beacon's _build_summary keeps its own single-line parse (language
boundary) but now has a cross-reference comment to parseSessionFile.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
beacon.py had 5 raw "http://localhost:3000" literals spread across 3 functions
(_open_cockpit, _cockpit_poll, _web_stop) plus a tooltip string.
agent-hook-bridge.sh had 2 more.
Both scripts now read COCKPIT_URL from the environment with a localhost:3000
default, defined once at the top of each file (module constant in Python,
readonly variable in bash). A single env-var override now propagates everywhere
without touching code — covers non-default ports, remote deployments, and CI.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_poll_choice used `if data.get("choice")` — Python truthiness — which
silently skips an empty string. When cancelActiveBeaconSessions writes
choice:"" to the session file, the poll loop would see "" and keep waiting
until the full timeout, then exit with code 1. The bash caller then falls
into the "native popup failed → fallback slot 1" branch and injects a
second prompt on top of the one already sent by the control panel.
Fix: use `is not None` so empty string is returned immediately. The
caller also switches from `if choice` to `if choice is not None` so ""
is printed to stdout and bash correctly exits via [ -z "$choice" ] && exit 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Part 1 — atomic bash lock: replace TOCTOU check-then-write on
agent-stop-active-<tab> with POSIX noclobber `( set -C; : > lock ) 2>/dev/null`.
Concurrent stop hooks that both used to pass the test-before-write now
race atomically; only one wins. Stale locks (>90s) are overwritten.
Part 2 — cancel open beacons on panel inject: cancelActiveBeaconSessions()
scans /tmp/cockpit-beacon/*.json for active sessions matching the tab and
sets choice="" — the empty-string sentinel that causes beacon.py's polling
loop to return "" and bash to `exit 0` cleanly.
/api/inject calls this immediately after injectIntoTab() succeeds.
Part 3 — beacon popup auto-closes on cancellation: polls GET /api/beacon/:id
every 2 s; calls window.close() as soon as choice !== null (set by Part 2).
Clears on unmount or when the user submits their own choice first.
Together these three parts prevent the popup and the control panel from
both injecting prompts into the same Zellij tab.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
go-to-tab-name is fire-and-forget — it returns before Zellij has switched
the visible tab. Under load the 0.3s sleep was too short, causing write-chars
to type the prompt into whichever pane happened to be focused at that moment.
Both inject paths now poll zellij action dump-layout after go-to-tab-name and
wait until the focused tab matches the target (up to 1s, 50ms intervals).
In the common case the switch completes in <50ms, so typical injection is
faster than before; the edge case where it was silently misfiring is fixed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Path A (beacon popup → bash inject) was telling Claude to write only
'done' and 'next', while Path B (control panel → TypeScript inject)
told it to write all five: done, next, tests, todos, health.
The control panel and SSE stream read all five fields; the missing
three caused projects injected via popup to show no test count,
no TODO count, and no health status until the next TypeScript inject.
Both paths now use identical wording:
'When done, update {file} with exactly these lines:
done / next / tests / todos / health'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: beacon.py called _cockpit_ready() using /api/control (slow DB+git
endpoint, 4+ seconds cold) with a 2s timeout. When OrangeCat fired rapid
consecutive stop hooks, this check failed even with Cockpit running, so
_start_cockpit() spawned extra npm run dev processes that inherited the bash
command substitution pipe (stdout). Their startup output flooded the captured
`choice`, jq parsing failed, and the script exited silently with no injection.
Fix 1: Add /api/health endpoint (instant response) — beacon.py now uses this
instead of /api/control for all liveness checks; also fixes the curl check
in agent-hook-bridge.sh.
Fix 2: Redirect _start_cockpit() subprocess stdout/stderr to DEVNULL — like
_open_browser() already does. Prevents npm run dev from inheriting the pipe
and polluting the captured choice.
Fix 3: Add concurrent stop guard at top of handle_stop — skips the popup if
another stop is already active for the same tab (within 90s). Prevents
beacon storms from rapid turn completions.
Also increased _poll_choice timeout from 3s to 8s to tolerate cold route
compilation without dropping choices.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three fixes for the wrong-monitor popup problem:
- beacon.py: fallback uses primary screen instead of cursor position —
cursor can be on any screen but the terminal is usually on primary
- agent-hook-bridge.sh: writes claude-screen-<PANE_ID> from xrandr at
stop hook time if missing (context-limit continuations bypass the
claude() bash wrapper which normally writes it at launch)
- ProjectCard.tsx: auto-continue defaults OFF — require explicit opt-in
to prevent the Cockpit UI from auto-injecting a second prompt while
the user is already typing their own message in the same terminal tab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WindowDoesNotAcceptFocus is an X11 WM hint that blocks keyboard focus
even on deliberate clicks — so typing went to the terminal, the input
stayed empty, and the countdown/dismiss fired as if nothing was typed.
Fix: FocusCancelInput.mousePressEvent strips the flag and re-shows the
window so the WM routes keystrokes here. Track _input_engaged so _tick,
_choose, and _dismiss all respect a click (not just non-empty text).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root disconnect: when a choice was injected via bash (web beacon or PyQt popup),
the /tmp state files were never updated — agent-ready-<TAB> stayed written
(UI showed "waiting for input"), agent-current-prompt-<TAB> was never written
(no "running" banner), and the Control panel stayed stale until the NEXT stop
hook fired.
Fixes:
- agent-hook-lib.sh: add write_inject_state(tab, key, label) that clears the
ready/closed sentinels and writes the current-prompt sentinel immediately
after injection — same state update that /api/inject does for Control panel
inject button flows
- agent-hook-bridge.sh: extract inject_key and inject_label from the resolved
choice, then call write_inject_state after emit_or_inject_prompt
- agent-hook-lib.sh: add -- before prompt in write-chars call to prevent
prompts starting with - from being parsed as flags
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both were SSOT violations — PyQt respected ~/.config/agent-dashboard-settings.json
but the web beacon hardcoded its own values.
- beacon.py _web_stop: reads countdown_seconds from settings, passes as
?countdown=N query param when opening the Chrome app URL
- beacon page: reads ?countdown from window.location.search on load
(lazy useState initializer, SSR-safe via typeof window guard)
- /api/beacon/transcribe: reads whisper_model from settings file before
invoking transcribe.py, falls back to "base" if missing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace Web Speech API (cloud, silent failures) with MediaRecorder →
POST audio blob → Python Whisper (local, no internet) pipeline. Adds
real-time waveform visualisation, recording timer, and a clear
idle/recording/processing state machine with never-silent error display.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>