Header chips said "2 need you · 6 open" while the projects rail
underneath said "0 working · 0 ready · 2 open". Different
denominators ("need you" conflated attention + failed + waiting),
different verbs, same data — the user couldn't reconcile what
either number meant.
Header now mirrors the rail's structure: "X working · Y ready · Z
open", with the attention chip ("X need you") shown ONLY when
attention+failed > 0 — kept first in the row, kept red, kept loud
because it's the genuinely user-blocking signal. Rail still computes
its own counts from snapshots[].phase; both surfaces now read the
same vocabulary regardless of source.
"All clear" fallback preserved for the empty state when literally
nothing is going on (no attention, no working, no ready, no open).
Item 6 of the 7-item Elon-team-pass plan. Item 5 (page hierarchy)
is the last remaining piece.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
User audit 2026-05-31 surfaced three loud noise sources in the
project rows that were diluting every other signal on the page:
1. Saved-handoff dumps leaking into row activity text. Lines like
"Saved handoff: Wait for user to (a) resolve the OAuth blocker
by signing in with a fresh GitHub account..." were the agent's
own internal notes being pasted verbatim into the user-facing
table. getTabActivityText() now returns short lifecycle states
only — "Ready — pick the next task", "Agent open · idle",
"Closed", "Tab open · no agent process". Handoff content
belongs in a per-project expand/tooltip, not the always-visible
row.
2. "Last sync 6h ago" prefix repeated on every one of 21 project
rows when the daemon was offline globally. staleEvidenceLabel()
dropped the prefix in the common case — the global offline
banner already owns the "system is stale" signal; rows should
just describe last-known state. Preserve the prefix ONLY when
there's no other evidence to show (rare).
3. "Tab #1 Unlinked" dangling scratch tabs surfacing in the
workspace table. buildLiveTabRows now filters tabs that map to
no registered project — they're visible noise that the user's
actual zellij window already shows. The control surface is for
fleet ops, not a generic tab list. Test updated to assert the
filter behavior (Mystery tab dropped, registered tabs kept).
All three were silent UX papercuts that the SSOT and gate work
couldn't surface — the user had to point at the screenshot.
control-presenter tests stayed 19/19 after the test rewrite.
Items 2, 3, 4 of the 7-item Elon-team-pass plan. Items 5 (hierarchy)
+ 6 (header/rail vocab reconciliation) coming next.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The recurring "daemon offline" complaint had no UI path forward —
the only recovery was a terminal command, which broke the "fleet
control" value prop. Now solved with a 3-button row in the
DaemonStatusBanner that fires the systemd lifecycle directly.
New endpoint POST /api/system/daemon { action: start | restart |
stop | status } shells out to `systemctl --user <action>
cockpit-daemon.service`. Hard-coded unit name + action whitelist —
no user input flows into the shell command. RUNTIME_AVAILABLE gates
the route: cloud users get 403 with "Daemon control unavailable on
cloud — runs only on the local install."
New DaemonControls component renders three buttons (Play / RotateCw
/ Square icons) with state-aware disabling: Start is disabled when
already active, Stop is disabled when not active, all are disabled
on cloud with a tooltip explaining why. After each action the
component re-fetches state so labels reflect post-action reality.
DaemonStatusBanner integrates the controls into the "Local daemon
offline" branch, replacing the wordy install-instruction paragraph.
Cloud users now see a clear one-liner: "Open Cockpit at
http://localhost:3000 to start/restart the helper" — directs them
to the correct surface instead of leaving them stuck.
Local build + postbuild already deployed the route to the running
cockpit-app systemd unit; cloud picks it up on next Vercel deploy.
Closes the first item of the 7-item Elon-team-pass plan.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Live regression caught while sessioning with the user. After
b89fdfc shipped the status:working gate on /api/control/dispatch,
the daemon still fired autopilot injects into the user's terminal
— 5 injections in 90 seconds, despite status:working AND a pending
blocker file. Root cause: the daemon has TWO injection paths, and
b89fdfc only covered one.
Path A (gated by b89fdfc):
daemon watchdog → POST /api/control/dispatch → returns prompt
→ daemon writes to terminal via autopilot_dispatch_and_inject()
Path B (the bypass — fired all 5 times):
user click OR ReadyBanner auto-fire OR stop-hook re-fire
→ POST /api/orchestration/run
→ enqueueInjectCommand writes a pending_commands row
→ daemon polls pending_commands, consumes row
→ daemon writes to terminal via execute_inject()
Gates added at TWO chokepoints (defence-in-depth, since either
path can be reached without the other):
1. scripts/cockpit-daemon.sh:execute_inject() — reads local FS for
~/.claude/sessions/<tab>.md status field and the .blockers/pending/
directory count. Refuses the inject (returns 1, logs "REFUSED")
when either signal says the agent is mid-task. hard_stop bypasses
the gate since it's the literal kill switch.
2. src/app/api/orchestration/run/route.ts — reads cached session
state from project_states.sessionStatus (already pushed by the
daemon to the DB). Returns HTTP 409 with reason="agent-status-
working" when working. Saves a database write + pending_commands
queue entry vs letting the request through to be rejected by the
daemon-side gate.
Both gates exempt hard_stop and close_session (lifecycle intents
that end sessions, not start work).
The dispatch-gate test suite (11 tests, scripts/test/dispatch-gates.ts)
still covers the original /api/control/dispatch gate. New tests for
the orchestration/run + execute_inject paths are TODO — gating them
without a live integration test scaffold means I'd be unit-testing
mock interfaces. For now, the live witness is the daemon log line
"inject REFUSED — <tab> session status=working" when a refused
inject lands.
Daemon stopped manually during this session; will be restarted by
the user after they pick where to take the UI work next (we had a
7-item plan queued before this bypass was found).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Root frustration from 2026-05-31 was that the autopilot's current
mode wasn't visible enough — the user couldn't tell at a glance
whether a click on any prompt chip would queue, send-immediate, or
trigger AI composition. AutomationPolicyControl was a small text
dropdown labeled "Automation" that gave you the mode name but no
visual state.
AutomationPolicyControl now renders a colored, optionally pulsing
status dot that encodes the mode at a glance:
off → gray dot, no pulse
queue_only → amber dot, no pulse
next_best → blue dot, pulsing (Groq off, canned template)
strategist → green dot, pulsing (Groq on, autonomous)
Each mode gets a long tooltip that explains exactly what dispatches
when. The strategist tooltip teaches the safety controls in one
line: "Set status:working in your session file to pause; raise a
blocker to halt." Direct surfacing of the gates shipped in the
earlier commits.
Plus a tooltip on the Next-best CTA itself ("Strategist picks the
next task autonomously … This click dispatches without preview")
so the asymmetry from the universal fill-first UX is explained
right where it happens. Every other prompt-click on /control fills
the textarea; this CTA bypasses it. Users need that signal in the
moment, not buried in docs.
No structural changes to IntentPanel layout — the existing 3-row
hierarchy (composer / library / workflow shortcuts) is already
readable. Original plan called for a Composer/Library/Workflows
restructure; deferred because the visual prominence win is in the
pill + tooltip pair, not in another layout pass.
All 9 test suites green: 167/167 (89 home + 11 dispatch-gates +
19 control-presenter + 22 autopilot-defaults + 7 push-notifications
+ 4 onboarding + 6 onboarding-heal + 5 db-url + 4 orchestration).
Closes the 4-commit fix-it-all-once-and-for-all set with the user
asked for. The autopilot now: refuses to fire when status:working
or blockers pending (b89fdfc), reads from a single prompt SSOT
(1bfe2d1), fills first on every surface (aaec08a), and shows its
state unmistakably (this).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same prompt click did different things depending on which surface
the user was on:
/control DimensionSection → SEND immediately (no preview)
/control ProjectPromptLibrary → FILL textarea (banner active = send)
/beacon ProjectPromptLibrary → SEND immediately
AskIvy global-scope prompt → SEND immediately
AskIvy project-scope prompt → FILL input
Recent chips everywhere → FILL textarea
The user named this directly: "only ones under prompt library fill
the field." Confirmed via audit — three distinct fork points across
four components, each making its own local decision about whether a
click should commit or preview.
Universal rule now: clicking any prompt anywhere fills the composer
textarea so the user previews/edits before sending. Per-prompt
opt-in via the new sendNow:true field in the SSOT (added to
PromptTemplate type in the previous commit) for prompts where
preview makes no sense — currently only hard_stop, which is a
literal kill switch. sendNow prompts render as a two-segment chip:
the main fill action on the left + a small ↪ Send button on the
right, so the bypass is visible in the UI rather than hidden in
code.
Component changes:
- project-profile-sections.tsx: DimensionSection now takes
required onFill + optional onRun. Default click → onFill. When
prompt.sendNow is true AND onRun is provided, render the ↪ Send
button as a sibling. Hover state separates fill (raised surface)
from send (warning-tinted) so users see the difference.
- ProjectProfile.tsx: thread onFillPrompt through as a required
prop, pass to every DimensionSection. handleRun (existing send-
immediate path) stays wired for the ↪ button.
- ProjectCard.tsx: wire onFillPrompt={setCustom} so the existing
textarea state becomes the universal target.
- project-intent-panel.tsx: drop the bannerActive ? onSendText :
onCustomChange branch from ProjectPromptLibrary's onSelect. Now
always onCustomChange — same behavior on every surface.
- BeaconClient.tsx: ProjectPromptLibrary.onSelect switched from
submit(CUSTOM_CHOICE_PREFIX + prompt) to setCustom + focus.
Beacon library now matches /control library — fill first.
- AskIvyModal.tsx: drop the t.scope === "global" ? send : setInput
branch. All clicks fill the input. Globe vs FolderOpen icon stays
to indicate scope visually, but click semantics are unified.
No prompt content changed. No new components. Only the click
handlers were rewired to match the universal rule.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Until today, prompts lived in two parallel files: 35 entries in
~/.config/agent-prompts.json (out-of-repo, snake_case keys,
dev/ship/vision taxonomy + dimensionId) and 35 in
src/config/prompt-library.ts (in-repo, kebab-case ids, domain
taxonomy + scope). 12+ duplicate pairs with subtly different
bodies; 6 security prompts in TS only (invisible to DimensionSection
in /control); 6 control prompts in JSON only (invisible to /prompts
library page and ProjectPromptLibrary modal). Adding a new prompt
required two edits in two formats. Real SSOT violation.
This commit promotes the in-repo TS file to canonical SSOT for
prompt METADATA (id, name, description, category, scope, style,
slot, sendNow). For the subset of prompts that also need to be
dispatchable by the autopilot daemon, an optional `agentKey` field
ties the TS entry back to the snake_case identifier the daemon
expects. JSON becomes a build artifact, regenerated from TS via
`npm run generate:agent-prompts`.
Mechanics:
- PromptTemplate type gains optional agentKey, icon, style, slot,
dimensionId, sendNow fields. Category enum gains "control" and
"content". CATEGORY_META extended. No breaking changes to existing
fields.
- All 6 JSON-only control prompts (hard_stop, blocker_create,
orient, unblock, roadmap_check, onboarding) added to TS with
agentKey set to their daemon key + dimensionId: "control". They
now appear in BOTH /prompts library page AND DimensionSection AND
remain dispatchable by the daemon. hard_stop is the only one
flagged sendNow:true (kill switch — preview makes no sense).
- /api/prompts/agent route gains a mergePromptSources() helper that
reads JSON, transforms TS entries with agentKey, dedups by key
(TS wins on conflict). The DimensionSection in /control now sees
the unified set without a UI change. Old reference to
PROMPTS_FILE() preserved so the daemon still works during the
incremental migration.
- New scripts/generate-agent-prompts.ts generator transforms
PROMPT_TEMPLATES → AgentPrompt[] and writes them back to JSON,
preserving any legacy JSON entries not yet migrated. Wired as
`npm run generate:agent-prompts`. Backup of pre-regen JSON kept
at ~/.config/agent-prompts.json.bak-20260531-ssot.
Verification: tsc clean. Generator dry-run output: 35 entries (29
legacy + 6 TS-overridden). The 6 TS-sourced entries are byte-
identical to their old JSON bodies (same key, same prompt text).
Adding a new prompt is now ONE TS edit. Migrating the remaining 29
JSON-only entries to TS is a follow-up commit; the bridge keeps
everything working during the transition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Live-incident regression. Earlier today the autopilot injected a
2000-char next_best template into the user's keystrokes mid-typing
while they were composing a message to the agent, producing garbled
text like "wtf ust happened? what is this injecSetup (run, read
outputs):...". The session handoff said status:working — which is
documented in three places as the suppression signal — but the
daemon fired anyway because nothing in the dispatch pipeline
actually read the status field.
Root cause: agent-hook-bridge.sh:autopilot_dispatch_and_inject()
extracted done/next/tests/todos/health from the session file but
not status. The dispatch route's HandoffSchema didn't include
status either. The user trusted a guarantee the code never made.
Three coordinated fixes:
1. agent-hook-bridge.sh now reads `status:` from the session file
AND counts files in ~/.claude/sessions/<P>.blockers/pending/.
Either condition (status:working OR blockerCount>0) causes the
daemon to skip the dispatch HTTP call entirely — saves a network
round-trip and surfaces the gate in daemon logs.
2. The dispatch route's HandoffSchema gains a `status` field and
the body gains `blockerCount`. Defence-in-depth: even if a
custom integration or cloud-only caller bypasses the daemon's
client-side gate, the route refuses to act on a working status
or pending blockers. Two new DispatchResult.source values
(status_gate, blocker_gate) make these refusals greppable in
logs.
3. The gate logic moves out of the route handler into a pure
helper at src/lib/orchestration/dispatch-gates.ts so the
invariants can be unit-tested without spinning up a real Next
request. 11 inline tests cover: status:working wins over every
mode; blockers beat happy-path; legacy empty status preserves
existing permissive behavior; etc. Wired into
`npm run test:dispatch-gates`.
Closes the highest-impact symptom of the strategist's broken trust
model. The user can now leave autopilot on and trust that their
status:working handoff actually stops it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The pill-shaped mobile nav (.ui-mobile-nav) sat at z-50, same as Modal
and Drawer. When a drawer opened — e.g. project detail — the nav was
still painted over the drawer at the bottom of the screen, eating
~60px of vertical space and splitting attention. Demoted nav to z-40
and the More-sheet backdrop to z-30 so the layering goes:
z-30 more-sheet backdrop
z-40 nav
z-50 drawer / modal / more-sheet panel
Modals and drawers now cleanly cover the nav on mobile, which is the
conventional layering for "focused overlay over chrome".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After Goals (3f062a8) + Memory (1baa421) + Money/Habits (44e991a)
all landed the same grid-cols-3 gap-2 sm:gap-4 wrapper around three
stat cards, the className was repeated 4× — and the inner comments
explaining the density fix had degraded into "same as Goals" /
"same as Memory" chain references.
Extract src/components/ui/stat-row.tsx — a children-passing wrapper
that owns the canonical three-column grid. Each call site drops to
one line. Callers keep ownership of the card shape inside (StatCard
for Goals/Money/Habits, Card+CardHeader+icon for Memory) — the
primitive only owns the wrapper.
Mirrors the ScrollAffordance extraction (0429728) which paid off one
commit later (b44cf5d) when Thoughts needed the 5th surface and
landed with a single import + wrap. Same expected payoff here when
the 5th stat row eventually appears.
Fifth horizontal-scroll surface to get the treatment, but the first
one to use the extracted <ScrollAffordance> primitive (0429728)
instead of re-inlining the relative+chevron+fade pattern. Live audit
at 414px on cockpitapp.vercel.app/thoughts caught the tag filter row
("All / agents / ai / architecture / automation / a…") cut off mid-
word with neither a chevron nor a fade mask.
Also missing ui-scroll-fade-right (every other scroll surface had it
even before the chevron landed); added for consistency with the
other four sites.
Net: 5 of 5 horizontal-scroll surfaces now have the same affordance
treatment, and the most recent one shows the extracted primitive
paying for itself — single-line wrap, no copy-paste.
Codebase sweep after the Goals (3f062a8) + Memory (1baa421) fixes
found two more instances of the exact same pattern:
- src/app/(app)/(private)/money/page.tsx — Monthly Burn / Unverified
- src/app/(app)/(private)/habits/page.tsx — Active Habits / Completions / Best Streak
Both PIN-gated so the audit couldn't catch them visually, but the
source pattern was identical: grid-cols-1 sm:grid-cols-3 with three
StatCards stacking full-width on mobile.
Same fix: grid-cols-3 gap-2 sm:gap-4 everywhere. Stat row collapses
to a compact horizontal triplet instead of eating ~400px of vertical
space before the first list of subscriptions / habit cards.
After this commit, codebase has zero remaining `grid-cols-1
sm:grid-cols-3` stat-row instances. Pattern is now duplicated 4× —
extracting <StatRow stats={[...]} /> is the natural next refactor
when (if) a 5th surface lands.
Same density issue as Goals (3f062a8), same fix. Three single-stat
cards (Entities / Relations / Types) used grid-cols-1 sm:grid-cols-3,
stacking full-width on mobile and eating ~400px before the user saw
any actual recent-additions or activity content. Caught live on
cockpitapp.vercel.app/memory at 414px in this iteration's audit.
Drop to grid-cols-3 everywhere with gap-2 on mobile, gap-4 sm+. Short
labels (Entities / Relations / Types) and short values (1,324 / 11 /
5) fit comfortably in ~130px-wide cards at 414px. First "Recently
Added" card now near the fold instead of below it.
No layout change for desktop (already 3 cols).
Live audit at 414px on cockpitapp.vercel.app/goals: header + 3 stat
cards consumed ~400px of vertical space before the first actual goal
appeared, because grid-cols-1 stacked each StatCard full-width on
mobile. User saw one stat per ~140px scroll instead of all three at
a glance.
Drop grid-cols-1 sm:grid-cols-3 → grid-cols-3 (with tighter gap-2 on
mobile, gap-4 sm+). Short labels ("Active Goals" / "Avg Progress" /
"Total") and 1-2 digit values fit comfortably in ~130px-wide cards
at 414px; the sub line wraps to 2 lines at worst. Net: first goal
card is now ~250px above the fold instead of below.
No layout change for desktop (already 3 cols). Verified mobile via
live cloud screenshot post-deploy on next iteration.
Verifying /system on cloud after the resilience fixes (ee6df43 +
ef2ceff): the page rendered fine, but caught a real UI bug —
"Recent telemetry" header showed "all clear" while the body listed
10 warning rows ("api/control/dispatch · Groq fallback (key
invalid): groq 401"). Badge logic only counted level==="error" and
treated everything else as clear.
Reserve "all clear" for genuinely empty problem state. When there
are errors, badge stays red with the error count. When there are no
errors but there are warnings, render the warning count in the
warning tone. Both counts visible in a single source of truth.
Side observation worth filing separately: 10 groq 401s on cloud
mean the Strategist auto-inject mode is silently degraded to canned
next_best — env-var issue, not a code fix. The honest badge now
makes that situation visible from the System page instead of
hidden behind "all clear."
Sibling RecentFailuresCard already defended against query failure
with `.catch(() => [])`. MemorySummaryCard let getEntityStats throw
straight through Suspense — the most likely root cause of the
/system "Something went wrong" black-box screen that ee6df43 wrapped
with an error.tsx boundary.
Try/catch the query; render a small degraded card when the stats
can't be loaded, explaining the rest of System is unaffected and the
section will refresh on the next page load. Console.error keeps the
postmortem signal even when Vercel logs are unreliable
(pattern_vercel_log_fallback).
Now both server-component Suspense children on /system are isolated
— a failure in either renders a per-card degraded state instead of
falling through to the route-level error boundary. The page itself
stays functional.
Caught live on cockpitapp.vercel.app/system at 414px: the entire page
crashed into the global "Something went wrong" error with the generic
"Server Components render error" message — zero retry context, no
partial render. Per pattern_vercel_log_fallback the real cause is
opaque from outside (Vercel logs are unreliable on this stack).
Two-layer defense:
1. Wrap listCronJobsForUser (the only direct DB await on the page) in
try/catch returning []. AutopilotCard handles empty initialJobs
cleanly, so the rest of the route renders even when cron_jobs
query fails (Neon blip, missing migration, etc.).
2. Add error.tsx for the /system route. Any server-component throw
downstream (MemorySummaryCard, RecentFailuresCard) now renders a
route-scoped error card with the digest + a Retry button instead
of escalating to the generic global boundary. PageLayout shell and
nav stay intact.
Doesn't fix the root-cause query (still unknown which DB call is
failing on cloud — needs a debug_logs row from prod), but the page is
no longer a black-box dead end for the user.
The mobile right-edge chevron pattern (relative wrapper + absolute
pointer-events-none ChevronRight + drop-shadow halo + sm:hidden) had
grown copy-pasted across four scroll surfaces in four sessions:
- Today SummaryBar (4cb018c)
- Settings tab strip (7ab36d6)
- Projects status filter chips (0523927)
- Prompts CategoryBar (a017df8)
Each call site had reinvented the same JSX with minor threshold
variations. Adding a fifth surface meant copy-pasting again — and
any tweak to the chevron icon, drop-shadow, or threshold semantics
would need touching four files.
Extract src/components/ui/scroll-affordance.tsx — a layout-only
wrapper that takes children + childCount + optional threshold (default 4).
Caller still owns the scroll container's overflow/fade classes; the
component only contributes the relative wrapper + conditional chevron.
Behavior is preserved at every site:
- Skeleton SummaryBar: childCount={0} (no chevron, matches old)
- Real SummaryBar: childCount={totalChipCount} threshold={3}
- Settings tabs: childCount={TABS.length} threshold={4}
- Projects status chips: childCount={statuses.length} threshold={4}
- Prompts categories: childCount={visibleCats.length+1} threshold={4}
Settings outer wrapper keeps its border-bottom so the underline spans
full width even when the inner scroll container is scrolled. No
imports lost; lucide-react ChevronRight now imported in exactly one
place (the new component).
Fourth horizontal-scroll surface in the codebase to get the same
mobile chevron treatment as Today SummaryBar (4cb018c), Settings tab
strip (7ab36d6), and Projects status filter chips (0523927). Live
audit at 414px on cockpitapp.vercel.app/prompts caught "Engineering
(..." cut off at the right edge with neither a fade mask nor a
chevron — user has no cue the category bar is scrollable.
CategoryBar was also missing the ui-scroll-fade-right class entirely
(the other 3 surfaces had it for the opacity hint even if the chevron
was new). Adding both: the fade gives a subtle bg cue, the chevron
gives an explicit "more this way" affordance.
Threshold of visibleCats >= 3 matches the rough overflow point at
414px (1 "All" + 3 category chips ≈ first wrap-or-scroll boundary).
Pattern is now duplicated 4× — extracting <ScrollAffordance> is the
clear next refactor before a 5th surface appears.
eae42d9 added the user_projects ⨝ entities join + render, but gated
on "no description AND no status AND no maturity AND no health signals
AND no next_step AND no extraAttrs." Live audit caught the problem:
almost every project tile DOES have a description (the few that didn't
were the bare ones I was looking at when picking the conditional), so
the dirPath + agentPref chips effectively never rendered in practice
— the join was paying for itself with zero user value.
Drop the gate. Render whenever either field is set. The chips are
already small and muted (text-[10px], text-text-tertiary, surface-
overlay bg) so they don't compete with description/status/maturity
above — they read as runtime metadata footer, which is what the user
actually wanted ("show me where this project lives and what agent
runs it, on every card").
ui-micro-badge applies display:inline-flex; truncate (Tailwind shortcut
for overflow:hidden + text-overflow:ellipsis + white-space:nowrap)
doesn't compose with inline-flex because flex layout doesn't apply
text-overflow to anonymous text children. Long status strings (e.g.
"Strategic planning only - no code, nothing yet") overflowed the
180px max-width and got cut mid-word with no ellipsis, so the chip
read as broken instead of "more text than fits."
Caught during a fresh Projects mobile audit at 414px: Bitbaum's
status chip showed "Strategic planning only - no code, n" with the
final char clipped against the chip border.
Wrap the text in an inner <span class="truncate"> so the ellipsis
has a block-like target. Outer keeps max-width + overflow:hidden so
the chip itself is bounded. Title attribute (already present) still
provides the full text on hover. No layout/color change.
Third horizontal-scroll surface on mobile to get the same chevron
treatment as the Today SummaryBar (4cb018c) and Settings tab strip
(7ab36d6). Audit caught it live on Projects at 414px: the third
status chip ("Active") was cut off mid-word with no cue that the
filter row was scrollable — user would think they only had three
status filters when in reality they have eight.
Same pattern: wrap the scroll container in relative, add ChevronRight
pinned to the right edge inside the fade area on mobile (pointer-
events-none so chip taps fall through). Hidden on sm+ where chips
wrap. Conditional on statuses.length >= 4 — three chips fit at
414px without overflow, so the chevron would be misleading.
ControlFleetStatus renders "X needs you / X working / X open" chips
from the last daemon-pushed snapshot. When the daemon is offline, the
numbers are cached state from the last sync — but the chips rendered
as live (full opacity, green dot, attention color), so the user reads
"1 working" as "an agent is making progress right now" when in
reality nothing has been observed for 2+ minutes.
Audit caught this live on mobile: header read "Daemon offline · sync
2m ago", chip row right below it showed "1 working" with a green dot.
When daemonOffline or daemonStateUnknown, apply opacity-60 + a title
tooltip explaining the chip is cached observation from the last sync
(with the sync age inlined when known). daemonNeverSeen path is
untouched — counts are zero in that state, no chip renders.
No layout change, no behavior change; pure visual honesty.
Settings tab strip (Profile / Account / Location / Agent / Projects /
Team / Billing) reliably overflows at 414px and the existing
ui-scroll-fade-right mask alone is too subtle on iOS where native
scrollbars hide at rest. Caught in a fresh mobile audit — landed on
Settings, "Team" was cut off mid-word with no visible cue that the
strip was scrollable. User would think the app only has 6 tabs.
Same fix pattern as the Today SummaryBar chevron (4cb018c): wrap the
scroll container in a relative div, add ChevronRight pinned to the
right edge inside the fade area, pointer-events-none so tab taps fall
through underneath. drop-shadow halo lifts the icon off the fade
background. Hidden on sm+ where the strip fits without overflow.
Today's "Recent Agent Work" card rendered every dispatch as
"projectKey [adapter] · timeago" + body=customPrompt || intent. For
templated dispatches (where customPrompt is null), the body became
the raw intent string — visible as "next_best" sitting on its own
line under the project name. Live mobile audit confirmed: two
back-to-back rows both showed "next_best" as body text, looking like
malformed prompts rather than templated intents.
4373e84 already shipped the right pattern on the Control panel
Activity feed: small uppercase pill badge inline with project name
when intent is templated, body row reserved for custom prompts. Same
class strings here so the two views match visually.
Body paragraph is only rendered when a custom prompt exists —
templated dispatches stay compact (one row instead of two).
ui-scroll-fade-right alone is too subtle on iOS — native scrollbars
hide at rest, so a user landing on Today doesn't realize they can
swipe through more chips past the right edge. Caught during a live
mobile (414px) audit: chips visually fade off-screen with no
"there's more here" cue.
Wrap the scroll row in a relative container and add a ChevronRight
icon pinned to the right edge inside the fade area. pointer-events-
none so a chip tap underneath still lands. drop-shadow gives a
subtle halo that lifts the icon off the fading background.
Conditional on totalChipCount >= 3 — single-chip days don't need
the hint and 3+ is the rough threshold where overflow is likely on
a 414px viewport. sm:hidden ensures the chevron disappears once
chips wrap naturally on desktop.
Skeleton wrapper also gets the same relative div for consistent
layout while loading (no chevron — skeleton is fixed-width).
The Activity feed on each project card rendered every entry as a flat
"time + preview" row. A user scanning the feed couldn't tell at a glance
which entries were autopilot-fired Next best vs Test & fix vs a custom
prompt they typed by hand — the ledger threw the intent away and used
getIntentLabel as the body when customPrompt was null, so templated
dispatches just looked like short body text.
Carry intent through ProjectActivityEvent (null when customPrompt is
present) and render an uppercase pill badge before the preview when set.
Free-form prompts render unchanged. Existing copy + expand UX is
untouched.
Sample row reads "8m ago [NEXT BEST]" instead of "8m ago Next best" —
the badge is immediately visually distinct from the body text, so
scanning the feed shows the dispatch type at a glance.
aec0ef8 dropped the dashed "Add context →" placeholder, leaving bare
tiles with just a title. Honest, but the user still had to click in
to see anything concrete. user_projects already stores the SSOT for
project runtime metadata (dirPath, agentPref) — surfacing it on the
card removes the need for that click.
DB: add fetchRuntimeMetaByEntityIds() that joins user_projects by
entityProjectId. Use in both getProjects and getOrgEntityProjects so
the returned ProjectRow gains dirPath + agentPref fields. Single
parallel query per page-load alongside fetchAttributesByEntityIds —
no N+1.
UI: extend the Project type with optional dirPath/agentPref. Render
them as small mono chips on truly bare tiles (no description, no
status, no maturity, no health signals, no next_step, no extra
attrs) — the same gap aec0ef8 left visually empty. dirPath is
truncated to the last two path segments (e.g. ".local/share/foo")
with the full path in title-tooltip. agentPref renders as a micro-
badge. Drops out cleanly when both fields are null.
No behavior change on tiles that already render status/maturity/etc.
2381a82 made the "1 security risk" and "X projects need attention"
counts toggleable filters. Active state was ring-1 ring-{color}/40 +
bg-{color}-subtle — the SAME hue as the base chip text. From the user
side at a glance, engaged vs disengaged states looked nearly identical;
caught during a live cloud audit at desktop width where the only
visible cue was a faint outline.
Three small bumps:
- ring-1 → ring-2 with /70 alpha (more presence)
- font-semibold on the active label so the text weight contrasts
- inline X icon next to the label as a universally-understood
"click to clear" affordance (also doubles as the dismiss target)
Attention chip also gets the active-state text upgrade to
text-status-warning (was text-status-warning/80) so it brightens with
the rest of the engaged state.
Pure presentation; no filter logic change.
Bare projects (no description, no status, no maturity, no health
signals, no next_step, no extra attrs) rendered a dashed-bordered
"Add context →" box at the bottom of every tile. Caught during a
live cloud audit: in a 29-tile grid, every empty card had this
prompt dominating the visual — looked like a row of empty form
placeholders instead of a project portfolio.
The placeholder added zero data; the whole card is already clickable
via the wrapper's onClick, so the affordance to open and add context
is preserved. Bare tiles now show just the title (+ readonly badge,
action icons), which reads as "this project exists, click to learn
more" — same affordance, less visual noise.
extraAttrs path is untouched: when the user HAS set custom attrs
beyond the reserved set, those still render as micro-badges.
Smaller follow-up worth filing separately: surface dirPath + agentPref
from user_projects so even bare-attr tiles show concrete metadata.
That requires a query-level join (entities ⨝ user_projects) — not
in this commit.
e62abe6 made /api/control/agent enqueue switch_agent commands on
cloud instead of silently doing nothing. The control panel's "Last
switch" line now renders "Cockpit queued, AOZ queued" — honest about
the state, but doesn't tell the user when the switch will actually
land. On Vercel the daemon long-polls /api/control/commands every
~25s (8s default + variability), so the gap between "I clicked
switch" and "agent actually swapped" is up to half a minute.
Append "· daemon picks up within ~25s" when any result has
status==="queued". No suffix when everything was "restarted" (local
mode) or fully "skipped" — those are immediate-outcome states. Keeps
the line compact when context-free.
/api/control/agent updated the user's stored agent/model preference,
then — in cloud mode — returned tabResults=[{status:"skipped", reason:
"Local runtime not available — cannot restart zellij tabs remotely."}]
and did nothing else. So a user clicking "switch to Cursor" in the
cloud Control UI silently failed to actually switch any open agent;
the pref was saved but no agent ever swapped.
Mirror the inject route's cloud-mode pattern: enqueue a switch_agent
command per registered project. The daemon's execute_switch_agent
(0ccb43d + 9a3bd61) handles tab-not-open as a no-op via its quit
signal path, so queueing for every registered project is safe — closed
tabs are skipped, open tabs get the switch. Also forwards model
explicitly; the daemon's _conf_model_for_tab fallback covers absent
model.
SwitchTabResult union gains "queued" so the response type is honest
about what happened on cloud. Local mode still uses the execSync
path with restarted/skipped/failed.
RunOrchestrationBody already accepts an optional `model` field
(z.string().max(160).optional()) and forwards it into orchestration_runs
.payload for trackable runs — but enqueueInjectCommand at the cloud-
mode branch dropped it. So autopilot next_best fires (the most common
caller of /api/orchestration/run on cloud) queued an inject without a
model, and the daemon launched the agent at its built-in default even
when the user had explicitly pinned a model in the request.
Add `model: request.model` to the enqueue payload. No new DB lookup —
the daemon's _conf_model_for_tab fallback (9a3bd61) already covers
the case where model is empty by reading from agent-projects.conf
(synced from user_projects.modelPref). This commit closes the
explicit-model path; the implicit-pref path already worked.
28dae15 made /api/inject carry modelPref into the inject payload, but
execute_launch_agent and execute_switch_agent in the daemon only read
model from their queue payload. So the autopilot watchdog (which
spawns fresh agents via launch_agent without pinning a model) and the
agent dropdown's switch flow (when called without an explicit model)
both fell back to each agent's built-in default — a project pinned to
"opus" still got Sonnet when autopilot restarted it.
Pattern matches the execute_inject auto-launch path (501a6e7): when
payload model is empty, look up _conf_model_for_tab. Three call sites
now do the same fallback consistently — auto-launch, launch_agent,
switch_agent.
No payload schema change; pure daemon-side defensive lookup. Caller-
supplied model still wins; conf model fills the gap.
501a6e7 added modelPref to the conf-file path so the daemon's auto-
launch could read it. But /api/inject didn't write model into the
pending_commands payload at all, and execute_inject's dispatch case
didn't extract it — so cloud-side dispatches still launched with
empty model and fell back to each agent's built-in default. The
conf-file fallback worked, but a user who dispatched right after
changing modelPref (before the 5-minute conf-sync) would miss it.
Three-file change makes the explicit path land:
- InjectPayload: add model?: string. Mirrors the field shape already
on LaunchAgentPayload + SwitchAgentPayload.
- /api/inject route: extract dbMatch.modelPref, include as
`model: eventModel` in the executeInject payload.
- cockpit-daemon.sh: dispatch case reads payload.model; execute_inject
accepts a 7th arg and prefers it over _conf_model_for_tab in the
auto-launch branch. Empty payload model falls through to conf.
Precedence is now: payload_model > conf model > agent's built-in
default. tsc clean, daemon syntax OK.
/api/agent/projects already returned model = project.modelPref for
every project, but the daemon's sync script only wrote 3 columns
(tab|dir|agent), so the model field was silently discarded between
cloud DB and local conf. _agent_launch_cmd accepts a model arg and
passes it through (codex --model, gemini -m, etc.), but the
auto-launch path in execute_inject was hardcoded to empty string.
End result: a Codex project pinned to gpt-5 still launched gpt-5.4,
a Gemini project pinned to flash launched 1.5-pro.
Three-file fix:
- sync-agent-runtime-config.py: write tab|dir|agent|model. Header
comment updated.
- agent-hook-lib.sh: _conf_agent_for_tab IFS read adds a 4th field
variable (legacy 3-col lines still work, unread field is empty).
Add _conf_model_for_tab mirror that reads the 4th column.
- cockpit-daemon.sh execute_inject auto-launch branch: look up the
conf model and pass it to _agent_launch_cmd.
Verified against a synthetic 4-col conf:
DemoProj → agent=claude model=opus
AOZ → agent=gemini model=flash
Legacy → agent=grok model=<none> (3-col line, no break)
NonExist → agent=<none> model=<none>
Not yet wired: launch_agent / switch_agent paths still take model
from queue payload only. Cloud /api/inject doesn't pass model in
payload yet either — those are the next iterations.
483b9b7 added a startup sync + 5-minute periodic re-sync of
agent-projects.conf from cloud. Multi-source polling forks one child
per extra base URL, and each child re-ran the same sync — so a
2-source setup (local + cloud) made 2× HTTPS requests to
/api/agent/projects every 5 min, plus 2 startup syncs, all writing to
the same file on the same filesystem.
Gate both the startup sync and the _conf_sync_loop on
COCKPIT_DAEMON_CHILD == "". The parent owns the conf; children inherit
it via shared filesystem. Atomic os.replace in the sync script already
made the parent-only path safe.
Also guard _CONF_SYNC_PID in _shutdown so children (which never set
the var) don't error on SIGTERM.
Verified live: pre-restart had 2 `sleep 300` PIDs, post-restart has 1.
Both daemon URLs still polling correctly.
agent-projects.conf is the local mirror of user_projects (name, dir,
agent_pref). sync-agent-runtime-config.py fetches /api/agent/projects
and rewrites the file — but only ran from agent-hook-bridge.sh on
agent stop hooks. So a pref change made via the web Settings page sat
unapplied until the next agent stopped: could be hours.
a6b8658 just made _resolve_live_adapter read this conf as a fallback
to honor the user's agent pref. Pairing that with a daemon that never
re-reads the cloud meant the fallback would silently use stale data.
Fix: run sync once at daemon startup (non-blocking, background), and
schedule a _conf_sync_loop that re-syncs every 300s. Both also write
to the same conf file via tempfile+os.replace, so reads are atomic
and never see a half-written file. _CONF_SYNC_PID is killed in the
existing _shutdown trap so SIGTERM cleans both background loops.
Bounded staleness: any pref change in cloud Settings now propagates
to the local daemon within 5 min (or instantly on next daemon restart),
without needing an agent stop event to trigger sync.
/api/inject already honors user_projects.agent_pref end-to-end via
the payload (16d21c2), but the daemon side of agent resolution still
fell back to "claude" whenever it was reached without going through
/api/inject: stop hooks, beacon callbacks, autopilot watchdog. So a
Gemini project's stop hook ended a Claude session and the watchdog
re-launched Claude regardless of the user's pref.
Add _conf_agent_for_tab() to read the agent column from
agent-projects.conf (the local mirror of user_projects.agent_pref
written by the daemon). Insert into _resolve_live_adapter priority
after /proc scan and current-prompt JSON, but before the heuristic
tab-name suffix and the legacy resolve_adapter — so live evidence
still wins, but the user's configured preference beats heuristics.
Verified against the live conf:
AOZ → gemini
Cockpit → claude
OrangeCat → <none> (no conf agent column set)
NonExistentProject → <none> (tab not registered)
BeaconSettings was a single section with six unrelated fields stacked
vertically. From the user side it read as a long scroll where the
Voice (Whisper) options sat right after the Auto-inject mode picker
with no visual cue that they govern different things — easy to scroll
past or wonder why transcription is under "Beacon."
Group the six fields under three uppercase-kicker headings within the
same section so they share the one Save button at the bottom (no
state churn, no extra forms):
- Auto-inject: mode + idle gate + countdown (when/how the loop fires)
- Popup behavior: popup mode + advantage/trade-off callout
- Voice transcription: provider + Whisper model
Each subgroup is space-y-5 internally; subgroups separated by hr
dividers with space-y-8 between. Reorders fields slightly so related
controls live together (idle gate + countdown moved into Auto-inject).
Pure presentation; no behavior, API, or schema change.
The general install one-liner at the top of Agent Tokens settings was
inline <code> in a sentence — long URL, hard to select cleanly, no
copy button. The token reveal panel had a Copy button for the bare
token but only inline-code for the full pre-filled install command,
meaning users either copied the token then re-typed the curl line, or
hand-selected the long command in the paragraph.
Surface the install command as its own code block with a Copy button.
Inside the token reveal, also add a "one-shot install (token pre-
filled, no prompt)" block with its own Copy button — that's the path
most users actually want: one click → run on the new machine → done.
Refactor: single boolean `copied` becomes `copiedKey: string | null`
so multiple Copy buttons can each show their own check-mark without
stealing the others' state.
Token rows in Settings → Agent Tokens listed only label + a single
"Last used X" or "Created X · never used" line. With three+ tokens
("dell", "local cockpit daemon", "local-cloud-daemon-2026-05-30") and
each daemon.env / .env.local holding a ck_… string, the user couldn't
tell which row mapped to which env file without a database query.
API GET now returns prefix = token.slice(0,12) + "…" alongside the
existing metadata. POST also returns prefix so the optimistic insert
in the client gets the same data without a refetch. Full token is still
stripped server-side (this only leaks the first 12 chars — same shape
GitHub uses for PATs, sufficient to identify, insufficient to forge).
Component renders the prefix as a mono code chip next to the label,
with a tooltip explaining the match-against-env use case. Created date
is now shown on every row (not just on never-used ones), with "last
used X" appended when available — so you can age-out unused tokens.
"1 security risk" and "1 project needs attention" rendered as plain
text. User saw the count, wanted to jump to those projects, had to
scroll the grid by eye and read tile decorations to find them.
Turn both into toggleable buttons. Click "security risk" → grid filters
to projects with security_vulnerability set. Click "needs attention" →
grid filters to projects with any health signals. Click again or press
Escape to clear. Active state gets a subtle ring + filled bg so the
user knows the filter is engaged. Tooltip explains what the click will
do in both states.
Both counts compose with the existing query + status filter, so a user
can search "auth" + filter to "security risks" + a specific status all
at once.
User-side audit caught the Projects status-filter chips rendering as
mid-sentence truncations: "Active — deployed as syst…", "Live — German-
language landi…", "150-line Prisma schema, no C…". Ugly and unhelpful —
the truncation cuts off exactly where the canonical label ends.
Add shortStatusLabel() that cuts at the first natural break (em/en
dash with spaces, comma, colon, " - ", open paren/bracket). Falls
back to hard truncation when no break exists or the head is too short
to be meaningful. CHIP_MAX_CHARS dropped 28 → 24 so tighter labels.
Filter value still uses the full original string; only the displayed
chip text changes. Full text remains in the title tooltip on hover.
Sample (verified):
"Active — deployed as systemd service" → "Active"
"150-line Prisma schema, no CI yet, pre…" → "150-line Prisma schema"
"Pre-launch, Q2 2026 expected" → "Pre-launch"
"Strategic planning only - no execution yet" → "Strategic planning only"
"Active development" → unchanged
The top-of-Today chip row was 10+ chips in a single flat row with no
hierarchy. "0/2 habits" sat next to "1 urgent" — mixing units and
priorities, and "Brief Ivy" was styled identically to a status chip
even though it's the only actionable button. Reported as confusing
during a user-side audit.
Group into three semantic clusters: counters (what I have today —
goals, habits, contacts), alerts (what wants me — overdue, urgent,
due-soon, stalled, deadlines, drafts), fleet (what my agents are
doing — running, waiting, degraded). Thin vertical dividers (visible
on sm+, swallowed by horizontal-scroll on mobile) separate clusters
so the eye lands on each block as a unit.
Brief Ivy gets its own visual treatment — green border + subtle bg —
to read as an action rather than a status. Sits after the final
divider so it never feels like another count.
No data changes; pure presentation.
CI/GitHub and Calendar cards both showed "X shows here once the local
daemon is connected" on Vercel. User saw this with the daemon CONNECTED
and pushing state successfully — naturally assumed Cockpit was broken
because the message implied daemon = the missing piece.
The actual constraint: github-status.sh and gog calendar shell out to
local CLIs (`gh`, `gog`) from the Cockpit *web server* process. Vercel
can't shell out to those. Daemon connectivity is irrelevant — even a
fully-paired daemon doesn't push CI / calendar snapshots upstream.
Replace both empty states with honest copy that names the real cause
(the gh/gog CLI lives on the web server's host) and the actual next
step (open the page on local Cockpit at http://localhost:3000).
Follow-up: have the daemon push a CI snapshot so cloud can render it
too — captured as audit punch list, not in this commit.
"Recent Agent Work" said "No agent runs in the past 24 hours" even on
days with five active dispatches — the query only looked at
orchestration_runs, and manual injects via /api/inject (Send box,
prompt library, autopilot next_best) never land there. Spotted live
during a user-side audit: dispatched ~10 prompts this session, Today
card still read "No agent runs."
Add getRecentDispatches() reading from prompt_history with the same
24h window. When orchestration_runs is empty but dispatches exist,
render the dispatches with adapter chip + project + timestamp + the
prompt label, prefixed with "No completed orchestration runs yet —
showing recent dispatches." Truly quiet days still show the original
empty copy.
POST /api/inject defaulted to "claude" whenever the body didn't pin an
adapter, so every project ran Claude regardless of agent_pref — a Gemini
project got Claude, a Cursor project got Claude. The per-row agent
preference is the SSOT exposed by /api/control and used everywhere in
the UI for the agent dropdown; the inject path was the one place
ignoring it.
After we resolve dbMatch (the user's project row), check agent_pref and
upgrade the provisional "claude" default only when the column is set
AND valid against ORCHESTRATION_ADAPTER_IDS. Caller-supplied adapter
still wins; agent_pref is just the fallback.
Daemon side already prefers payload_adapter (from d6215fe) before
defaulting to "claude" in execute_inject, so this commit closes the gap
end to end: web UI → /api/inject reads agent_pref → payload carries it
→ daemon launches the right agent in the right tab.
execute_inject glued the 20-line handoff block onto every dispatched
prompt. Each Claude turn then tried to write the handoff file, hit the
existing-file guard, and prompted the user "Do you want to overwrite
revamp-it.md?" — surfaced live during cloud-dispatch verification.
Also wasted ~500 input tokens per inject across every project running a
Claude/Cursor/Codex agent.
Gate the append on /tmp/agent-handoff-sent-<tab>. After a successful
inject, touch the sentinel. Clear it everywhere the agent process is
considered fresh:
- close_tab (tab destroyed)
- hard_stop / close_session (lifecycle dispatch)
- launch_agent (explicit launch)
- switch_agent (different agent process)
- auto-launch branch in execute_inject (daemon spun the agent itself)
Net result: first dispatch of each session carries the template; every
subsequent dispatch in the same session is just the user's prompt.
execute_switch_agent sent /exit then Ctrl+C, but Claude's TUI swallows
both when it's busy mid-task — so the new-agent launch_cmd was typed
into the live old agent (claude received "cd /path && agent" as a
prompt instead of bash executing it). Verified live: ran switch claude→
cursor, daemon logged "done ✓" but the old claude PID was still alive
and cursor never started.
Add _kill_agents_in_dir as the escalation path: after the existing
quit+Ctrl+C dance, if the agent is still running in the project dir,
SIGTERM the PIDs (basename-matched, cwd-scoped), wait 1.5s, then SIGKILL
the holdouts. Only fires when the gentler signals didn't land, so
well-behaved CLIs (grok, codex, openclaw) keep their clean exit path.