Replaced inline custom class string (bg-surface-raised, border-border-subtle,
etc.) with the SSOT ui-input-tight class.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
With 15 projects across multiple status values, the status filter chips
let the user quickly narrow to production, early-stage, etc. Chips appear
only when 2+ distinct status values exist; badge updates to show
filtered/total counts; health-issues summary stays anchored to all
projects for full fleet visibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Public /u/[username] now shows active projects that have a gitUrl (as
linkable cards with stack tags) and the 4 most recent published essays.
Added getPublicProjects() query that filters for active+gitUrl rows.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The chips were mixing ui-chip-filter/active with conflicting rounded-full,
px-3, py-1.5 overrides, producing unpredictable layout. These dot-indicator
pills are a distinct shape from ui-chip-filter (rounded-xl), so they now use
clean custom state classes. Clear button uses ui-chip-filter without overrides.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
applyToOpenTabs only read parseProjectsConf(), missing projects managed
via the DB (Settings → Add project). Now merges conf-file and DB sources,
deduplicating by tab name so conf-file projects aren't restarted twice.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Same bug as inject route — DB-only projects (added via Settings) were
returning 404 on clear-context. Now falls back to user_projects lookup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Projects added via Settings (user_projects table) were silently 404-ing
on injection because readProjectsMap() only read the conf file. DB-only
projects now resolve correctly; projectPath is sourced from dirPath too.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Projects can now be dragged to reorder in Settings. Position is persisted
per-row via PATCH. The control panel's idle section respects this order as
the final tiebreaker (after activity state and git activity).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
renderTaskForAdapter was always appending the generic "update the session
handoff" block, even though buildPromptWithSession already appends the
specific file-path version. Both Claude and Codex paths call
buildPromptWithSession, so they received the instructions twice.
Now only OpenClaw gets the generic block (it uses the render output
directly, without buildPromptWithSession wrapping).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- appendProjectDevLog: read-modify-write capping at 50 entries so the
JSONB column can't grow unboundedly with auto-capture enabled
- DevLogList: show HH:MM alongside date — multiple same-day entries from
auto-capture are now distinguishable at a glance
- Remove getTopIntentFrequencies + IntentFrequency type — never called
anywhere (YAGNI)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously dev log entries only appeared when the PyQt beacon popup was
used. Now every time the agent updates session.done (detected on the 30s
control poll), a dev log entry is appended automatically — covering
auto-continue, direct panel injections, and all other flows.
Also extracts appendProjectDevLog to db/queries/user-projects.ts as a
shared function, removing the duplicate DB logic that lived privately in
the beacon route.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
With a fixed limit of 30, a busy project could consume all rows and leave
other project cards with zero "Sent today" history entries. Now fetches
max(30, projectCount * 5) rows so every project can get up to 5 items.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a collapsible "Sent today" section below SessionSummary in every
project card showing the last 5 injections for that project with
timestamps and truncated prompt text. No extra DB query — groups the
already-fetched recentActivity (24h global) by project key in the
control API route. Falls back to empty / hidden when no injections exist.
Closes the injection history tracking loop: data written in
prompt_history (383c166), now surfaced both globally (ActivityLogPanel)
and per-project (InjectionHistorySection).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Every injection now writes to prompt_history (fire-and-forget, same as the
existing orchestration events). This feeds two already-built but data-starved
features:
- ActivityLogPanel on the Control page (recentActivity feed)
- recentCustomPrompts autocomplete in each project card's composer
Stores full customPrompt text, canonical projectKey, projectPath, adapter,
and resolved intent. Uses parseProjectsConf() to resolve the project dir
without an extra map lookup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs made AI Merge completely non-functional:
1. Groq path: GROQ_API_KEY not set → silently falls through
2. OpenClaw path: `capability model run` → should be `infer model run`
(wrong subcommand, always fails with parse error)
Replace the slow infer/Codex fallback (4+ min) with the same
`openclaw agent --agent main` pattern that Ivy uses (Claude, ~20-30s).
Removes the custom spawn() infrastructure in favor of runTool().
Groq fast path unchanged — add GROQ_API_KEY to .env.local to enable it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All project_state rows now carry the real user_id (from getCurrentUserId,
which falls back to DEFAULT_USER_ID for unauthenticated terminal agents).
Removes the or(isNull) workaround in getProjectStatesByUserId — it was
a SSOT leak that would expose every row to a second user if one were added.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Zellij has no API for writing to an unfocused pane, so every injection
must switch tabs. Previously the terminal stayed on the target tab after
inject; now it switches back immediately (sub-200ms flash, imperceptible).
Also wraps onInject at the ControlPanel level with error handling so
failed injections (tab not found, zellij unavailable, etc.) surface
as a visible error message rather than silently disappearing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AI Merge now tries Groq first (sub-3s) when GROQ_API_KEY is set
- Falls back to openclaw local Codex (~4 min) when key absent
- Thoughts post: groq-neon-and-the-next-infra-layer.md — sequencing
plan for Groq activation, Neon prod wiring, and auth rollout
To activate fast merge: add GROQ_API_KEY to .env.local
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- images-as-agent-input.md: case for visual context in agent prompts,
implementation sketch (temp file bridge), and MVP scope
- control-vs-projects-two-views-one-system.md: SSOT mapping for both
tabs, what tiles show, improvement opportunities, latent SSOT violation
(profile file vs user_projects record)
Also fix: control tile health text now uses getHealthShort() — was
showing full verbose string "GOOD — deployed; all tests pass" instead
of compact "GOOD"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous implementation called `openclaw agent` (requires gateway session)
which always timed out. Switched to `openclaw capability model run` via a
detached process group spawn so Node can kill the whole process tree on
timeout. Local model inference takes 3-5 min; set ceiling at 6 min.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously the PyQt popup always started with auto-continue ON, ignoring
any pause set in the web control panel (only mattered when Cockpit was
down at popup-open time).
Fix: write/delete /tmp/cockpit-auto-continue-<tab> whenever the web app
toggles or resets auto-continue state (new API route). PyQt reads the
sentinel on init and skips starting the countdown when paused.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract PromptInput and QueueList from project-card-sections.tsx into
project-composer.tsx (was 855 lines, now ~355)
- Extract IntentButtonPanel into project-intent-panel.tsx
- Beacon popup: collapse 4 disconnected rows into unified composer card
(textarea + mic in corner + one-row action bar with pause/queue/send)
- Beacon popup: progressive disclosure for prompts — action chips in
flex-wrap row, more prompts hidden behind "More (N)" toggle chip
- PROMPT_STYLE in control.ts is now SSOT for chip CSS classes across
both ReadyBanner and beacon popup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the scattered status-line + PromptInput + word-count blocks with
one rounded card that holds the textarea, waveform strip, and action bar as
a single visual unit.
- Textarea: borderless, transparent bg, mic button in the top-right corner
- Waveform strip: appears between textarea and action bar only while recording
- Action bar: one row — pause toggle · status text (flex-1) · queue icon · Send pill
- Send button fills (bg-text-primary) when there is content; ghosts when empty
- Status text adapts: countdown preview → hint shortcuts → recording/transcribing states
- Removed word/char count (noise in a command interface)
- PromptInput import dropped from beacon page; QueueList retained
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ProjectTile passed the full health string (e.g. "GOOD — deployed; all tests pass")
as the HEALTH_COLOR key, which never matched the short lowercase keys, so the dot
always fell back to text-text-muted.
Extract getHealthShort() to control.ts and use it in all three call sites
(ProjectTile, project-card-helpers, project-card-sections) — eliminating the
duplicated split logic while fixing the bug.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace 4 hardcoded hex values in MermaidDiagram themeVariables with
resolveColorVar() which applies each CSS custom property to a hidden
element and reads the browser-computed rgb() value. This keeps Mermaid
diagrams in sync with the design token SSOT in globals.css rather than
maintaining a parallel set of hex literals.
Fallbacks are neutral dark greys in case the var is missing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Double-inject (control panel + web beacon firing at same second):
- Add 1s grace period to beacon auto-fire. /api/inject already calls
cancelActiveBeaconSessions synchronously; the 1s gap + 500ms close-poll
gives the cancel time to propagate and close the beacon before it fires.
- Reduce beacon close-poll from 2s to 500ms so cancels are detected
within 500ms rather than up to 2s.
Queue wipe on reboot (/tmp cleared, localStorage persists):
- Queue API GET now returns { queue, exists } so callers can distinguish
"file not found" (exists=false) from "file is empty array" (exists=true).
- Poll skips overwrite when exists=false, preventing empty file result
from wiping a non-empty localStorage queue after reboot.
- Mount effect bootstraps the file from localStorage when file is absent,
so PyQt sees the queue on its next poll cycle after a reboot.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add /api/beacon/queue/[tab] GET/PUT — file bridge for cross-process
queue sync between PyQt and web app
- stateFile.queue() centralises /tmp/agent-queue-{tab} path
- Normalize tab to lowercase in route + _beacon_popups._queue_file()
so all three consumers (web beacon, control panel, PyQt) share one file
- remove() now syncs to file immediately from localStorage rather than
waiting for the React render → effect cycle; fixes queue item
reappearing on next beacon because page closed before PUT completed
- isComposing includes listening||processing so countdown pauses during
mic recording and Whisper transcription, not just when text is present
- Auto-fire effect also guards on listening||processing as a safety net
for edge case where countdown initialises at 0
- Status line shows "Recording — auto-continue paused" / "Transcribing…"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ticker was running even while the page was still fetching prompts,
so a slow load could consume the entire 12-second window before the UI
was interactive. Now the interval is suspended while prompts.length === 0
— the auto-fire guard was already there, this makes the visible counter
match. The user always sees the full remaining window once the page is ready.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the user had previously paused auto-continue and the control panel was
not open in the browser, the beacon page would open with the stale "off"
state from localStorage — countdown showed "Paused", beacon.py polled 120s
with no response, and nothing was injected.
The beacon is a one-shot popup; each open should default to ON. Users can
still pause during the 12-second window. The control panel remains the
authority for persistent auto-continue state across sessions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs in the transcription route:
1. Chrome's MediaRecorder sometimes produces webm without an EBML EndOfFile
tag (especially short recordings). Whisper's internal ffmpeg subprocess
exits 254 on this, and the only error surfaced was "Command failed: python3"
because e.stderr was a Buffer without .trim(). The real traceback was lost.
2. Added execFileAsync encoding:"utf-8" so err.stderr is a string and the
actual Python/ffmpeg error reaches the browser.
Fix: pre-convert webm→wav with our own ffmpeg invocation (-err_detect ignore_err
for lenient parsing) before handing the file to Whisper. Fails fast with a
human-readable message if the audio is genuinely undecodable, rather than
letting it blow up inside the Python process with an opaque traceback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
React state updater closures run during the next render phase, not at setState
call time. The prior shift() captured item = q[0] inside setQueue(fn) and
returned it, but item was always null — the updater hadn't run yet. Every queue
drain silently fell through to next_best.
Fix: read from localStorage (the synchronous SSOT), write the sliced array back,
then call setQueue to sync React state. Atomically returns the correct item.
Also extracts useMicComposer hook (H3 audit) to eliminate the duplicated
pendingMicActionRef + appendTranscript + wrapSend/wrapEnqueue boilerplate
that was copy-pasted between IntentButtonPanel and BeaconBody.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- sendIntent("next_best") and send() legacy path now drain queue first before
calling the AI planner — queued items always take priority
- enableAutoContinue() called on each new ready cycle so persisted "off" state
doesn't leave the countdown permanently paused across sessions
- Beacon auto-fire guarded on prompts.length === 0 (prevents closing before
prompts load); fires remove(0) when using queue item so it's drained atomically
- PromptInput: items-end outer flex + fixed h-10 buttons so Queue/Send don't
stretch as the textarea grows; Pause/Play removed from action button row
- Pause/Play relocated to a labeled footer row ("Auto-continue on/off") in both
running and idle states, consistent with beacon popup pattern
- RunningBanner: custom prompts shown as line-clamp-3 instead of "Custom prompt"
header + truncated 2-line fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bash was writing identical /tmp sentinel files under both naming schemes
simultaneously (agent-ready-{tab} AND claude-ready-{tab}) and TypeScript
was reading with double-fallback (?? stateFile.claudeReady) logic.
Now:
- Bash stop handler writes only agent-* sentinels (new canonical names)
- Dual-delete lines kept so stale claude-* files on disk are still cleaned up
- TypeScript reads only agent-* (no ?? fallback); 4 dead stateFile.claude*
helpers removed (claudeClosing, claudeSentinel, claudePrompt, claudeLock)
- claudeReady + claudeClosed kept for the cleanup unlinkSync calls in
inject/orchestration routes
- notification handler simplified: single-name checks, 6 dead lines removed
- agent-config.ts comment updated to "legacy names — cleanup only"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
control-fast-state.ts had a single-line regex parser; sessions/route.ts had a
more capable multi-line buffering parser that stops at ## sections. Both parsed
the same on-disk handoff format (done/next/tests/todos/health).
Add parseSessionFile(raw) to session-content.ts — the canonical implementation
using the multi-line algorithm. Both callers now import it; the local parse
functions are deleted. control-fast-state.ts shrinks from 17 lines to 5.
The Python beacon's _build_summary keeps its own single-line parse (language
boundary) but now has a cross-reference comment to parseSessionFile.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove global keydown typingActive listener — any keypress was pausing the
countdown, making it appear paused by default; now only pauses when the user
is actively composing (customFocused / custom.trim())
- Add control:ready-at:{tab} to localStorage when agent enters ready state;
both ReadyBanner and BeaconBody initialise their seconds from this shared
origin so both windows always show the same remaining number
- Beacon countdown was display-only and fired nothing at T=0; now submits
real injection (queue[0] first, then primary prompt) with autoFiredRef guard
- Thread tab prop through ProjectBanners → ReadyBanner for shared timestamp read
- Add readyAtKey() to control-storage.ts (SSOT for the key string)
- Drop DEFAULT_BEACON_COUNTDOWN_S fallback path in favour of readyAt; URL param
still used when no readyAt exists (manual popup without control panel)
- Improve idle project card headers: show "last 2d ago · good" context line
instead of floating health badge; git +N tooltip added
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ProjectCard had the same SSR bug as usePromptQueue: the lazy useState
initializer ran on the server (window absent), returned false, and the
first client-side write effect then stored "off" — silently disabling
auto-continue every time the control panel page loaded.
Fix: new useAutoContinue(tab) hook uses the same initialized-flag pattern
as usePromptQueue so the stored setting persists across page loads.
Side effects:
- Eliminates triple duplication of the control:auto-continue:${tab} key
- Removes the 2s polling loop from the beacon popup (storage event is
sufficient since popup and control panel are separate windows)
- Removes toggleAutoContinue local function from beacon page (hook owns it)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
usePromptQueue started with a lazy useState initializer that called
window.localStorage. On the server (SSR), window is absent so the
catch block returned [], and the first client-side write effect then
persisted [] to localStorage — silently wiping any items queued in
a previous session.
Fix: start with [], hydrate from localStorage in a mount useEffect
(client-only), and gate the write effect behind an `initialized`
flag so the pre-hydration empty state is never persisted.
Also move the beacon window auto-fit effect from BeaconPage into
BeaconBody so queue.length is in scope — the window now re-sizes
when items are loaded from localStorage or added via the + button.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Beacon popup could read autoContinue state but had no way to
change it — user had to switch to the control panel to pause.
Now a Pause/Play icon button sits inline in the status row and
writes directly to the same localStorage key the control panel
reads, so both windows stay in sync instantly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract BeaconBody component so usePromptQueue is called once per project
(eliminates the previous dual-write pattern where beacon had its own
localStorage queue helpers that duplicated the hook's operations)
- Replace single-line <input> with multi-line <textarea> + overlaid mic
button — matches control panel PromptInput exactly
- Replace ArrowRight send icon with Send; add ListPlus "Add to Queue" button
so users can stage prompts from the popup (Alt+Enter also works)
- Remove inline queue state/helpers (writeQueue, removeFromQueue,
reorderInQueue, editInQueue) — all queue ops now go through usePromptQueue
- autoContinueEnabled sync stays in BeaconBody (queue sync is handled by hook)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reorder (↑/↓) and inline edit were only wired up in the running-agent
branch; the idle-agent branch rendered QueueList without those handlers,
silently disabling the features when no agent was running.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
usePromptQueue gains reorder() and edit() operations.
QueueList in control panel: up/down chevron buttons to move items;
click item text to edit inline (Enter to save, Escape to cancel).
Beacon popup queue: same reorder/edit pattern — double-click text to
edit, ↑/↓ to reorder, X to remove without sending, click text to
send-and-remove. All writes go directly to localStorage so control
panel reacts via the storage event listener added earlier.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
usePromptQueue now listens for storage events so the control panel
reacts instantly when the beacon popup modifies the queue.
Beacon popup queue now matches control panel QueueList style (numbered,
first item highlighted, X to remove). Clicking a queue item removes it
from localStorage before submitting — prevents double-fire on next
auto-inject.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BeaconSettings "Use web UI beacon" label was backwards — enabling it
skips the popup entirely (control panel only). Renamed to "Control panel
only (skip popup)" with accurate description.
Also syncs mic status messages between beacon popup and control panel:
"No audio detected" → "No audio — speak closer…", "Processing…" → "Transcribing…".
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reads control:auto-continue and control:queue localStorage keys (same
origin, same SSOT as the control panel) — 2s poll + storage event.
Queue items appear above primary buttons; paused state shows ⏸ badge
on slot-1 and updated controls-row text.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>