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>
Auth.js v5 in production rejects unrecognized hosts by default, causing
every session check at localhost:3000 to throw UntrustedHost and spam
the journal. The error prevented sign-in from working at all on the local
production server.
Fix: set trustHost from AUTH_TRUST_HOST env var (sourced from .env.local
by cockpit-app.sh at startup). Vercel keeps working via the existing
VERCEL=1 auto-trust. Local .env.local has AUTH_TRUST_HOST=true added.
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>
Next.js 16 renamed middleware.ts → proxy.ts. The old file was never
deleted, causing the build to fail with "both middleware and proxy file
detected." Merged the missing public-route exclusions (sign-up,
forgot-password, reset-password) into proxy.ts and deleted middleware.ts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The daemon was calling claimNextPendingCommand(getDaemonUserId()), which
only claimed commands stored under the isDefault user's row. Commands
enqueued by a session authenticated via GitHub OAuth (a different DB row
for the same person) were silently ignored and never executed.
Fix: daemon now fetches all distinct userIds from user_projects and
claims commands for any of them. Also makes the claim atomic via a
transaction with FOR UPDATE SKIP LOCKED, preventing a theoretical
double-claim race if two pollers hit the endpoint simultaneously.
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>
getUserIdsByProjectNames: replace case-sensitive inArray with lower()-based
equality so conf-file tab names with different casing still resolve the
right user. Also fixes potential LIKE-wildcard injection via ilike.
prefer_browser_ready_ui: the old "open browser window" beacon mode was
replaced by PyQt-primary months ago. The toggle has been a no-op ever
since — remove it from BeaconSettings and the API to stop misleading users.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getDaemonUserId() returns the isDefault user's ID, but the owner may be
logged in as a different user (e.g. GitHub OAuth creates a separate row
when the setup user has no email). This caused project_states to be stored
under user A while the SSE read for user B — showing all 20 projects idle
even with Claude running in multiple zellij tabs.
Fix: look up which user actually owns each project via user_projects, fall
back to daemonUserId only for unregistered projects.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves canonical tab name from the user's own DB projects only,
consistent with the same fix applied to agent and inject routes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
applyToOpenTabs in /api/control/agent was merging the owner's conf-file
projects with the current user's DB projects, allowing any authenticated
user to force-restart the owner's Claude sessions.
/api/inject was resolving canonical tab names and project paths from the
owner's conf file before falling back to DB — now DB-only for both.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
beacon.py calls /api/health (to detect if Cockpit is up) and /api/beacon
(to create/poll/patch sessions) without a session cookie. With these
routes protected the calls were silently redirected to /sign-in, causing
_create_web_session() to always return None and breaking two-way sync
between the PyQt popup and the Control panel ReadyBanner.
/api/beacon writes only ephemeral /tmp data — no user-sensitive state.
/api/health is a no-op check. Both are safe to expose publicly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No longer referenced in any application code after the data isolation
audit replaced all user-resolution paths with getSessionUserId().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both /api/control and /api/control/stream fell back to parseProjectsConf()
when the authenticated user had no DB projects yet. The conf file contains
the owner's personal project list, so any signed-in user with no projects
of their own would see all of the owner's projects in their control panel.
Fix: drop the fallback entirely. Each user now sees only the projects in
their own user_projects rows. The owner already has their projects there,
so backward compatibility is unaffected. New users who skip onboarding
or haven't added projects yet see an empty control panel — correct.
Also removes the now-dead parseProjectsConf import from both routes and
collapses the usingUserProjects conditional into a single filter+map.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three-part fix:
1. auth.config.ts — add session callback to propagate onboardedAt from
the JWT payload so the middleware can check it without a DB lookup;
add authorized() gate that redirects authenticated-but-not-onboarded
users to /onboarding for all page routes (API routes pass through so
the /api/me and /api/user-projects calls from the onboarding page work).
2. sign-up/page.tsx — redirect to /onboarding after registration instead
of /today, so new users immediately enter the username + first-project
setup flow.
3. db/queries/users.ts — remove the premature onboardedAt: new Date()
from createUser(). New self-registered users now have onboardedAt=null
until they complete /onboarding. createInitialUser() (owner account)
and the invite flow keep their immediate onboardedAt, since those users
don't need guided setup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When accessing the control panel from Vercel (or any remote browser)
and the local daemon is offline or has never connected, the DB shows
agentRunning=false for every project — not because they're idle, but
because there's no live signal. This caused the Cockpit project itself
(with an active Claude session) to appear in the "Idle projects" section.
Fix: when daemon is offline/never-seen, collapse the active/idle split
entirely and show all projects in the main list. The DaemonStatusBanner
already explains why state is stale; the fleet view no longer claims
projects are idle when it simply doesn't know.
Also made ControlMetricCard.note optional so the "N idle" note can be
suppressed in the stat card when daemon state is unknown.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced the hard-coded default-user link in the signIn callback.
Previously, every new GitHub login was linked to the default user.
Now allowDangerousEmailAccountLinking lets the DrizzleAdapter link
GitHub accounts to existing Cockpit users by email match (safe: GitHub
verifies email addresses). New users get their own account; returning
users continue via existing account lookup. signIn callback reduced to
profile field updates only.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Security fixes:
- auth.config.ts: middleware now allows COCKPIT_DAEMON_TOKEN bearer requests through,
so the local daemon works correctly after middleware was added in the previous commit.
Individual daemon routes still enforce their own auth; middleware is the first gate.
- lib/session.ts: removed DEFAULT_USER_ID fallback that silently returned the owner's
data for unauthenticated requests. Replaced with:
requirePageUserId() — server components/actions: redirects to /sign-in if no session
getSessionUserId() — API routes: returns null for explicit 401 handling
getCurrentUserId() is now a deprecated alias for requirePageUserId().
Call-site migrations:
- 22 server component files (pages + today/* + system/*): getCurrentUserId → requirePageUserId
- 35 API route files: getCurrentUserId → getSessionUserId + explicit 401 guard
(one exception: beacon appendDevLog helper silently skips on no session to avoid
breaking the beacon response for an internal logging side-effect)
- project-states/[key]: fixed concurrent Promise.all that mixed data fetch with auth
Result: every data-access path now explicitly enforces authentication. Unauthenticated
requests to server components redirect to /sign-in; API calls return 401 JSON. No path
silently falls back to owner data.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a per-setting choice between local Whisper and Groq cloud so the
operator can force local when Groq rate-limits hit, or force Groq when
the runtime isn't active. 'auto' preserves the old behavior.
Stored in ~/.config/agent-dashboard-settings.json alongside whisper_model.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MediaRecorder uses 'audio/webm;codecs=opus' as MIME type; splitting on '/'
gave 'webm;codecs=opus' as the extension, which Groq could not recognize.
Now strip everything after ';' so Groq receives 'audio.webm'.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 'fleet' and 'security' as first-class categories, each with its own
color token (amber and red). Fleet Control leads with 'Next Best Step' as
the flagship prompt — the autonomous agent execution entry point — plus
Continue Task, Test & Fix, Commit & Push, Review & Clean, Full Health Check.
Security gets six prompts covering the full threat surface: Security Audit,
Auth & Session Audit (IDOR, CSRF, session fixation), Data Exposure & Privacy
Audit (PII mapping, GDPR), API Security Review, Dependency CVE Scan, and
OWASP Top 10 Check. All six are detailed, actionable, and tuned for the
multi-user / private-data context of the platform.
All fleet prompts are featured so they appear in Quick Access. The two new
categories are ordered first so they're the most discoverable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Multi-select merge was silently broken when the agent was waiting/idle
— the most common state for queue editing. The running-state branch
already passed the prop; the non-running branch was missing it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a project is focused, the brain panel and metrics grid collapse
so the ProjectCard expands to fill the full page width. A compact
horizontal tab bar replaces the old banner — each active project
appears as a pill with a live status dot, clicking switches focus
without returning to the fleet view first.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two behavioral fixes:
1. remove() side effects were inside the setQueue updater — React Strict Mode
and concurrent mode can invoke updaters multiple times, causing double file
writes and duplicate PUT requests to /api/beacon/queue. Moved localStorage
write and writeToFile() call outside the updater; updater is now a pure
filter. This matches the pre-existing pattern used by shift().
2. ProjectCommanderCard.advance() bypassed the queue entirely — it went straight
to onRunWithBrain("next_best") even when items were queued. Switching to
commander view silently broke queue dispatch. Fixed: now calls shiftQueue()
first, injects the queued item if present, falls back to next_best otherwise.
Also surfaces queue state in the card: context line shows queue[0] when ready,
button shows "Send (N)" with a count tooltip instead of plain "Continue".
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>
- After drag-to-reorder, selected Set still held old indices — item X selected
could now refer to a different item at that position. Clear on drop instead.
- remove() was reading from localStorage which may lag behind React state when
called immediately after enqueue(). Switch to setQueue updater form so next
is derived from the authoritative React state, then write localStorage and
file synchronously inside the updater before returning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Queue was the most important interface — the bridge between the human's intent
and agent execution — and it had three reliability failures:
1. Items "came back": time-based poll skip window raced with async writes
2. Double-write on remove(): direct file write + effect-triggered write
3. Janky drag: native HTML5 DnD with only a background flicker on hover
Fixes:
- content-based sync guard (lastWrittenRef): poll only applies updates when file
content ≠ last write — our own echoes are silently skipped regardless of timing
- single write per action: remove()/shift() set lastWrittenRef before setQueue so
the sync effect sees a no-op and returns early
- @dnd-kit/sortable: smooth animated displacement during drag, DragOverlay for the
floating ghost, PointerSensor with distance:5 constraint prevents accidental drags
- multi-select: checkboxes on each item, "Merge (N)" concatenates selected items
with double-newline at the first selected position, clears selection after
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
LaunchTabModal now has an optional "Initial task" textarea. When filled:
- Server writes the prompt to /tmp/agent-queue-{tab} immediately (queue
file fallback — beacon auto-continue picks it up on first stop).
- Server polls /proc every 3s for the agent process to appear in the
project dir, then injects directly via injectIntoTab (up to 30s / 10
attempts). Queue file is cleared on successful direct inject.
- Button label changes from "Launch" → "Launch & run" when a task is set.
No changes to the no-prompt launch path — fully backwards compatible.
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>
Applies the same FetchErrorState pattern used by Weather/Calendar/GitHub
cards — shows a friendly message with a Retry button instead of bare static
text on fetch failure. Also adds intervalMs:30s so RAM/disk numbers stay
live without a manual page reload.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
useFetch gains an optional intervalMs parameter that silently re-fetches
in the background. Uses setRevision (stable useState setter) directly in
the interval — no ref pattern needed.
Applied intervals: calendar 5 min, weather 10 min, GitHub CI 2 min —
so the Today page stays current for users who leave it open all day.
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>
All three cards were showing raw error strings ({error ?? data?.error})
to users with no recovery path. Fixed across the board:
- useFetch: add refetch() function (revision counter) + reset loading/error
on re-fetch so stale state doesn't persist between attempts
- FetchErrorState: new shared component — friendly message + Retry button
- WeatherCard: add error/data.error branch → FetchErrorState; "Unavailable"
now only shows when runtime is offline (not when tool actually fails)
- CalendarCard: replace raw error div with FetchErrorState + refetch
- GitHubStatus: same fix
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The daemon offline/never-connected state was surfaced only as a
hidden sm:inline span with a title tooltip — invisible on mobile,
cryptic on desktop. Replace with a full DaemonStatusBanner that:
- Renders below the main grid when daemonNeverSeen or daemonOffline
- Shows two states: "not connected" (first time) vs "offline" (went away)
- Displays the exact shell command to start/restart the daemon
- Notes where to find the COCKPIT_DAEMON_TOKEN
- Is dismissible per-session via local state
- Header retains a small amber dot indicator pointing to the banner
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/lib/plan.ts: PLAN_LIMITS config (free=3, personal=5, pro/team=∞)
with getProjectLimit() and isUnlimitedProjects() helpers
- db/queries/user-projects: add countActiveProjects() for efficient count
- POST /api/user-projects: enforces limit for non-default users; owners
(isDefault=true) and unlimited-plan users are always allowed through
- ProjectsSettings: shows "N / limit projects" counter and "limit reached"
badge when at cap; Add button disabled with upgrade tooltip; upgrade
nudge banner links to /settings#billing
- Settings page: passes projectLimit=null for owner and unlimited plans,
or the finite limit for free/personal users
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GET /api/checkout/[plan]: auth-protected redirect route that creates a
Stripe checkout session (or bounces back to sign-in with callbackUrl
preserved if unauthenticated)
- Landing pricing CTAs now link to /sign-in?callbackUrl=/api/checkout/<plan>
when Stripe is ready, so the full funnel is connected end-to-end
- BillingSettings reads ?billing= query param on mount and shows a status
notice (success / canceled / error / not-configured / already-active),
then strips the param from the URL so it doesn't persist on refresh
- Suspense wrapper added around BillingSettings in settings page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The local credentials provider signs in only the default (owner) user, so
the post-acceptance signIn("local") call was always authenticating as the
wrong account. Added a user-password credentials provider that looks up
any user by ID and verifies their password hash, then wired the invite
page to use it with the userId returned by the accept API.
Also distinguishes expired vs already-used invite states so the error
message is specific rather than generic.
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>
"Local password" read as localhost-specific jargon. Renamed to "Password".
Divider now says "or owner password" to distinguish the admin bypass from
the GitHub OAuth path for regular users.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GoalCard was 319 lines (component limit: 300). State declarations and five
async handlers moved to use-goal-card.ts — business logic separated from
rendering. Component is now 239 lines, hook is 111 lines.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Attention bar was filled with routine "N uncommitted" noise from git dirty
state, crowding out real health signals (critical, failing tests). Git state
is already visible in per-project header chips and idle tiles.
Idle tile launch button showed "codex · gpt-5.4" which wrapped onto three
lines in the compact grid. Model is already in the title tooltip; showing
only the agent name keeps the chip single-line.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tabOpen propagation:
- Add tabOpen to FastProjectState; local path derives it from zellijTabCache,
cloud path reads it from DB (daemon-pushed).
- SSE change detection now fires when tabOpen changes so projects move
between active/idle immediately, not after the next 30s poll.
- mergeProjectPatches updates zellijTabs from incoming tabOpen patches
so the client's tab list stays live without a full page refresh.
Daemon status indicator (cloud mode only):
- daemonLastPushedAt computed from MAX(project_states.updatedAt) —
no extra query, derived from the already-fetched dbStatesArr.
- ControlPanel header shows "daemon Xs ago" when connected,
"daemon offline" when >90s stale, "daemon not connected" when never seen.
- Gives cloud users clear feedback when their local daemon is down.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three improvements for web (Vercel) users:
1. orchestration/run: for claude adapter in cloud mode, render the intent
prompt and enqueue via pending_commands instead of returning 503.
The local daemon picks it up and injects. Other adapters still 503
(they require local workers).
2. runtimeAvailable flag: exposed in ControlData API response and
threaded down to ProjectCard so cloud mode is detectable client-side.
3. ReadyBanner auto-inject: disabled when runtimeAvailable=false
(no onAutoInject prop passed). The local stop hook already handles
auto-continuation the moment Claude finishes — the cloud countdown
firing 12s later would double-inject on top of running work.
Manual dispatch buttons still work in cloud mode.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three-layer fix for silent launch failure on web:
- agent-runtime: discover ZELLIJ_SESSION_NAME via env or full session scan
so zellij action calls work when running outside a Zellij pane
- api/agent/launch: guard with isRuntimeAvailable() — returns 503 with
helpful message instead of hanging when launched from cloud/Vercel
- use-control-data: launchProject now checks res.ok and throws so the
error propagates to LaunchTabModal's error prop instead of silently
closing the modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously 9 of 14 views (Habits, Events, Money, History, Prompts, System,
Memory, Thoughts, Settings) were completely inaccessible from mobile — the
bottom bar only showed the 5 mobile:true items with no overflow path.
Add a 6th "More" button that opens a bottom sheet with the 9 overflow items
in a 3×3 grid. Sheet closes on tap-outside, on link navigation, or on the
X button. "More" button highlights as active when the current path is an
overflow item, giving correct active-state feedback.
No config changes — NAV_ITEMS is still the SSOT; OVERFLOW_ITEMS is derived
by filtering mobile:false at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Transcribe route: replace daemon-relay remote path with direct Groq Whisper
API call (whisper-large-v3-turbo). Cuts remote transcription from 8-15s to
2-4s and removes the polling/result-TTL complexity entirely. GROQ_API_KEY
must be set in Vercel env vars. Local path (Whisper via Python) unchanged.
Add callGroqTranscribe() to lib/groq.ts alongside the existing callGroqText()
so both text and audio inference share the same API client module.
Extract AgentSwitcherPopover from ProjectStatusChips (306→253 lines) into
its own focused file — removes the circular useRef/useEffect block from the
parent component.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>