Replace 2s polling loop with three event sources:
- File watcher on /tmp/agent-* sentinels (local, <50ms latency)
- Postgres LISTEN/NOTIFY on project_states (Vercel, ~200ms)
- HTTP push from daemon → SSE bus → immediate wake (both paths)
Fallback tick reduced: 10s local, 5s Vercel (was 2s unconditional).
Failed commands (ok=false in last 10min) now surface in AttentionBar
with per-item dismiss via localStorage.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge three duplicated health-signal tables (ISSUE_DISPLAY, HEALTH_BADGE_STYLE,
HEALTH_BADGE_ICON) into a single HEALTH_SIGNAL_CONFIG in project-badges.tsx.
Extract ui-tab/ui-tab-active/ui-tab-badge classes to globals.css, replacing
inline conditional strings in ProjectDetailTabBar. Fix accent-[var()] violation
with ui-range-accent, bg-black/20 with bg-surface-overlay. Improve loading
state to distinguish initial vs. background refetch, better error message.
Fix Escape key to skip when drawer is open; truncate long status filter chips.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Command pickup latency: 5s → ~100ms. The API now holds requests for up to
25s (local) / 8s (remote Vercel) until a command arrives, eliminating the
sleep-then-poll cycle. The push loop skips the POST when state is unchanged
(md5 hash comparison), cutting idle DB writes from ~30/min to near zero.
After each command execution, a background push fires immediately so the UI
reflects results without waiting for the next push cycle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Four truth issues fixed:
- "Closing" state was missing from both ProjectCardHeader and ProjectTile —
both fell through to "Ready" label + grey dot. Now shows "Closing" with
amber warning dot/tag matching the card's warning border.
- isClosing was never passed to ProjectCardHeader so a Closing case could
never fire even if added.
- "Open tabs" metric showed 0 when daemon was offline (zellijTabs is empty
with no daemon push). Now shows "—" with "daemon offline" note.
- stateLabel + stateTagClass duplicated independently in ProjectCardHeader
and ProjectTile. Moved to control-presenter.ts (SSOT, derived from tone).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 category chips in flex-wrap stacked into 3+ rows on narrow screens.
Apply the same horizontal-scroll pattern used on Projects/Events/SummaryBar.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Long status chip labels (e.g. project maturity descriptions) no longer
wrap into multi-row stacks on narrow screens — single scrollable row with
hidden scrollbar, wraps back to grid on sm+.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SummaryBar: scrolls horizontally on mobile (no-wrap + overflow-x-auto,
hidden scrollbar) so all pills fit in one row instead of 3; wraps
normally on sm+. Shorten "105 contacts need attention" → "105 contacts".
Add min-h-11/shrink-0 to Pill links and Brief Ivy button.
- LogConversationButton, QuickCaptureButton, IvyDispatchButton (plan/wrap):
add min-h-11 sm:min-h-0 so trigger buttons meet 44px touch target on mobile.
- ui-btn-row-action (CommitmentItem check/edit/delete): add
min-h-11 min-w-11 sm:min-h-0 sm:min-w-0 for mobile touch targets.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Control page: metrics (Control Inventory) now appear first on mobile via CSS
order swap; BrainConfig hero moves below. Description text hidden on small
screens. Desktop two-column layout unchanged (xl:order-none reverts to
source order).
Auth: .ui-auth-card padding tightened to p-6 on mobile (was p-8 everywhere).
Homepage: hero/section spacing halved on mobile (pt-16, mt-16, pb-16) so
content fits without excessive blank space on 375px viewports.
MobileNav: close-sheet button increased from p-1.5 to p-3 (28px → 40px
touch target, approaching the 44px minimum).
.app-main bottom padding reduced pb-24→pb-20 to match actual nav height.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The footer expand button was only rendered when `collapsed=true`, leaving
no way to collapse an expanded sidebar on viewports between 768–1279px
(where the brand-header toggle is hidden by `xl:inline-flex`).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove forcedTheme="dark" — enable system preference + user toggle
- Sidebar is now position:sticky height:100svh, never scrolls away
- Collapsed nav items show portal tooltips (escape overflow clipping)
using createPortal to document.body with slide-in animation
- Theme toggle in sidebar footer (sun/moon, persisted via next-themes)
- Footer utility buttons get hover tooltips when collapsed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inject route and codex/gemini adapter both unlink closing sentinel on non-lifecycle
dispatch to prevent the UI from staying in "Closing…" state if user re-dispatches
after a close_session was sent but not yet consumed by the stop hook. Claude adapter
path in /api/orchestration/run was missing this step.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mergeProjectPatches updated readyAt from SSE but dropped lockAt, so
isBeaconActive stayed false while the beacon popup was showing. Web UI
auto-continue countdown would start even with beacon open, risking
double-injection. Also add lockAt to the SSE change-detection predicate
so a lock-only change (e.g. lock expiry without readyAt change) propagates.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Route used getSessionUserId() (cookie-only); hook bridge sent no auth header.
Switch route to getApiUserId() (cookie + Bearer) and read COCKPIT_DAEMON_TOKEN
from env or .env.local fallback in patch_project_state curl call.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The claude adapter path injected the prompt but never wrote stateFile.prompt(),
so the UI showed no "Running: [task]" banner for any orchestration intent
(next_best, custom, etc.) dispatched via onRunWithBrain. Codex/gemini and the
inject route both wrote it; the claude run path was the only gap.
Added the write in the else branch (excluding hard_stop/close_session which
end sessions rather than start tracked prompts) — mirrors the inject route's
pattern and what the daemon now does for cloud-queued tasks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In cloud mode (Vercel), session content was never populated in DB —
the runtime-state route only accepted agent/lifecycle fields, and the
daemon only pushed those. The UI showed empty done/next/health/tests
in the ReadyBanner and ClosedBanner for all cloud-mode users.
Daemon reads ~/.claude/sessions/<tab>.md per project each push cycle and
merges sessionDone/Next/Tests/Todos/Health/UpdatedAt into the payload when
the file exists. Route extended to accept and pass these fields through to
upsertProjectState (absent = skip, present = update).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When sessionHealth is critical or sessionTests contain "fail", the server
no longer pops from the queue for next_best intent — mirroring the client-side
sessionHealthBlocksQueue() check. Previously the UI said "AI picks recovery
task — queue paused" but the server still ran queue items.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without this, dispatching close_session via onRunWithBrain (ReadyBanner or direct)
injected the prompt but never wrote the agent-session-closed-<tab> sentinel.
The stop hook would then fire as a normal stop (readyAt + beacon popup) instead
of writing closedAt, leaving the UI in the wrong state after a clean session close.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The isOrchReady ReadyBanner wrapped onSend with a mapClaudePromptToIntent
guard that returned early for any key not in CLAUDE_PROMPT_TO_INTENT (e.g.
browser_test, health_check, unblock). Clicking those buttons did nothing.
The parent onSend (send in use-project-card-actions) already handles
non-orchestration keys by calling onInject directly — the guard was
redundant. Removed the wrapper and pass onSend through unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
enqueue only called setQueue, relying on the effect cycle to write the file.
If the queue was empty and auto-continue fired before the next render, the
file would show an empty queue and next_best would run instead of the newly
queued item. Now enqueue reads the current localStorage state and calls
writeToFile directly, same as remove/shift.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reorder, edit, and mergeItems only updated the file via the React effect
cycle, while remove and shift wrote synchronously. If auto-continue fires
in the gap between a drag-reorder and the next render, the agent receives
items in the old order. All three mutations now read from localStorage and
call writeToFile directly before the state update, matching the remove path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codex had available: true hardcoded while gemini used getGeminiAvailability()
to probe the binary. On machines without codex, resolveNextAvailableAgent()
would wrongly suggest codex as the fallback, causing switch attempts to fail.
Now both agents gate on commandExistsInPath() + config-dir heuristic.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agent-config.ts (buildPromptWithSession), renderers.ts (openclaw path),
and cockpit-daemon.sh (_resolve_prompt) all emitted "todos: <count>"
while agent-hook-bridge.sh, install-beacon.sh, and prompt-library.ts
all emitted "todos: <count> TODOs". Agents dispatched from the web UI
would write "todos: 0" while beacon-fired agents wrote "todos: 0 TODOs",
producing inconsistent session files depending on which dispatch path ran.
Standardised on "todos: <count> TODOs" (the format present in all actual
session files and the majority of the emit sites).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three fixes found via browser inspection of the Control panel:
1. ThemeProvider: add forcedTheme="dark" — localStorage "light" was
overriding defaultTheme and rendering the entire app in light mode
2. SidebarFooter: remove ThemeToggle — no theme switching in a dark-only
product; it was the root cause of the stale localStorage value
3. project-intent-panel: cap idle-state recent prompts at 5 (was
unlimited); collapse whitespace/newlines in chip preview text so
multiline prompts don't blow out the chip height
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The fixed 900ms sleep before launching a replacement agent was fragile:
if Claude was stuck on a permission dialog or context-limit screen, the
/exit command wouldn't land and the new agent's launch command would be
typed into the running Claude session.
New behaviour:
- After sending the quit command, poll /proc every 200ms for up to 2s
until the outgoing agent process disappears from the project directory.
- If still running after 2s (stuck on a prompt), send Ctrl+C (key 3)
as a harder interrupt, then wait 600ms before launching.
- Also adds sendRawKey() to zellij.ts for raw keycode injection without
characters, and removes the duplicate userId null-check in cloud mode.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OAuth failures (OAuthAccountNotLinked, AccessDenied) redirect back to
/sign-in?error=... but the form previously ignored the error param,
leaving users with no feedback after a failed OAuth attempt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
callGroqText in lib/groq.ts now accepts an optional systemPrompt so all
callers share the same fetch logic and model constant (GROQ_FAST_MODEL).
ivy/route.ts had a local callGroq that hardcoded "llama-3.3-70b-versatile"
and duplicated the fetch call — replaced with callGroqText + GROQ_FAST_MODEL.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
settings/page.tsx line 31, auth.config.ts /sign-out check, and
verify-email/[token]/page.tsx redirects were still using string literals.
All now use ROUTES.* from config/auth.ts.
Deleted src/app/api/auth/verify-email/[token]/route.ts — unreferenced dead
code (email links go to /verify-email/[token] page, not the API route).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
appUrl() was defined identically in 4 files (forgot-password, register,
resend-verification, email.ts). Exported from email.ts; other 3 now import it.
reset-password was calling db.update(users) directly, bypassing
updateUserPasswordHash() that already exists in db/queries/users.ts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All .catch(() => {}) on fire-and-forget DB writes (upsertProjectState,
createOrchestrationEvent, insertPromptHistory, appendDevLog) now log via
console.error so failures appear in Vercel/journalctl logs. Responses are
still non-blocking — only visibility changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Completes the centralization started in 60c858d — 11 files, 20+ occurrences
of /sign-in, /today, /onboarding, and /sign-out now all import from
src/config/auth.ts ROUTES, making route renames a one-file change.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tailwind v4 auto-scans all project files including CLAUDE.md, which contains
`shadow-[var(--*)]` as a violation example. Tailwind generates CSS for this,
producing invalid `var(--*)` that crashes the PostCSS parser and causes all
CSS to fail loading on both dev and production.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resend SDK throws at construction when given an empty string API key, which
crashed next build on routes that import email.ts. Fix: lazy-initialize via
getResend() so the Resend instance is only created at send time, not module
evaluation time.
Route SSOT: create src/config/auth.ts with ROUTES and PUBLIC_NAV_LINKS constants.
Replace 25+ hardcoded "/sign-in", "/today", "/onboarding" etc. strings across
all auth pages, public pages, AuthShell, SignInForm, and SidebarFooter. Nav
links for public surface (landing + auth) now come from one place.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Login fix: production Neon user existed but had no email set (created via
owner-key flow). Updated the record directly — email and fresh password
hash now match local credentials.
Google OAuth: added Google provider behind GOOGLE_CLIENT_ID/SECRET env
vars. Sign-in page shows "Continue with Google" button when both are set.
X OAuth: added Twitter provider behind TWITTER_CLIENT_ID/SECRET env vars.
Sign-in page shows "Continue with X" button when both are set.
Both new providers use allowDangerousEmailAccountLinking so existing
email+password accounts link automatically on first OAuth sign-in.
Providers are conditionally spread into the providers array — absent
env vars = provider simply doesn't exist, no runtime error.
SignInForm: unified oauthLoading state across all three OAuth buttons
(only one can be in-flight at a time); replaced single githubLoading bool.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Articles had **bold**, *italic*, `code`, and [link](url) rendering as raw
markdown syntax. Added ri() inline-render helper that splits text on those
four patterns and maps each part to the appropriate React element. Applied
to paragraphs, list items, blockquote lines, and headings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The design refactor replaced className="flex flex-col max-h-[85vh]" with
className="ui-modal-scrollable". But ui-modal-scrollable included overflow-hidden,
which silently overrode the Modal panel's own overflow-y-auto — making all content
past the viewport clip with no scroll.
Fix:
- ui-modal-scrollable: drop flex-col + overflow-hidden; keep max-height + overflow-y-auto
so it is useful for simple whole-panel-scroll overrides
- RunModal, AskIvyModal: className="flex flex-col" — the panel's own max-h-[calc(100vh-2rem)]
already caps height; flex-col is all that's needed for sticky header/footer layout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Article covers model-agnostic dispatch vision: fallback chains, local models,
hardware layer, and why Cockpit sits above the model layer not inside any lab's
walled garden. 14 min read, tagged product/strategy/agents/dispatch/hardware.
Removes generateStaticParams + adds force-dynamic so new articles are live
immediately without a rebuild — page reads from the filesystem on each request.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- _beacon_config.py: add read_project_git_branch() (mirrors server-side parseProjectsConf logic)
- beacon.py: embed gitBranch in session JSON at write time so SSE/web consumers get it without a server-side lookup
- _beacon_popups.py: rewrite ContinuePopup header — green dot, project name, "Ready" badge, then chips row with agent chip + git branch chip; matches web beacon header exactly
- sse/route.ts: add git branch fallback enrichment for sessions written before this change
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BeaconSession type: add optional gitBranch field
- beacon/[id]/page.tsx: server component enriches session with git branch
via parseProjectsConf() + execSync('git rev-parse --abbrev-ref HEAD')
so branch is available in the initial render with no client fetch
- BeaconClient.tsx: header now shows agent chip ("Claude ready") and
git branch chip with GitBranch icon, matching the Control panel card
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Kill the duplicate countdown / auto-fire / button rendering inside BeaconBody
and replace with the ReadyBanner component that the Control panel already uses.
Changes:
- ready-banner.tsx: widen prompts type to PromptItem (Pick of the display
fields) so both PromptMeta[] (card) and AgentPrompt[] (beacon) are accepted
without casting — export PromptItem for external use.
- BeaconClient.tsx: remove countdown useState + two useEffects + manual
primary/action/more button rendering; add ReadyBanner with onAutoInject
wired to the same choice-selection logic; add recentPrompts fetch + display;
update header subtitle to show agent name (was hardcoded "session complete").
- api/beacon/recent/route.ts: new GET ?project= endpoint that returns
RecentCustomPrompt[] via the same DB query the control panel uses —
lets the beacon popup show "Reuse recent prompts" identically.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The production standalone server runs outside Zellij (no ZELLIJ_SESSION_NAME),
so calling zellij action directly from the server process silently no-ops.
Two changes:
1. executor.ts: gate direct injection on both RUNTIME_AVAILABLE *and*
ZELLIJ_SESSION_NAME being present — falls through to queue otherwise.
2. inject/route.ts: run filesystem side-effects (beacon cancel, state files,
handshake clear) immediately in the route handler; they only need /tmp
access which the server always has. injectFn is now just the Zellij write.
Result: localhost production server always queues; daemon (which IS inside
Zellij) picks up and injects with correct session context. Dev server
launched from within a Zellij pane still injects directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Four issues fixed:
- BeaconSession now carries countdownSeconds (read from settings file in both
the API route and beacon.py), so the web popup always shows the user-configured
value instead of a hardcoded fallback
- DEFAULT_BEACON_COUNTDOWN_S changed from 30 → 12 to match Python COUNTDOWN_SECONDS;
fallback is now consistent across all surfaces when no settings file exists
- BeaconClient uses session.countdownSeconds instead of AUTO_INJECT_S / URL param,
eliminating the split between readyAt-path (12s) and URL-param-path (30s)
- useAutoContinue default changed false → true so new tabs start with auto-continue
enabled, matching Python popup behaviour and isAutoContinueEnabledSync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The injectFn closure uses dynamic imports (await import('@/lib/zellij')) but
executor called it without await — the Promise was discarded, imports never
resolved, and execSync never ran. Localhost injection silently returned ok:true
while doing nothing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Email/password users had no in-app way to change their password —
the only option was the forgot-password email flow. Adds:
- PATCH /api/me/password — verifies current password, rejects OAuth
accounts (no passwordHash), enforces 8-char minimum on new password
- updateUserPasswordHash() helper in users queries
- "Change password" subsection in ProfileSettings, shown only when
the account has a passwordHash; includes inline validation for
length and confirm-match before the request is sent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All six components had try/finally without catch, so network errors
produced no user feedback and unhandled promise rejections. Each
mutation now catches and shows an inline error message or returns
false to its parent form. AddHabitButton and HabitsList.addHabit
now catch to return false instead of throwing into AddHabitForm.
HabitGoalLinks also handles !res.ok for link/unlink so API-level
failures surface instead of silently being ignored.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The edge runtime's regex engine doesn't reliably evaluate complex
lookahead patterns at compile time, causing /api/invitations/<token>
to return 401 instead of 404, blocking unauthenticated invitation
acceptance. Replace the regex test with pathname.startsWith which
is guaranteed to work in the edge runtime.
Smoke test /api/invitations/<token> now returns 404 (was 401).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>