Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: expose persistent CoS pause control
[._.]/ Adam Eivyb8b323815638
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex e5a5823691..537df4ca69 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -77,6 +77,8 @@- A programmatic-I/O run whose model **printed** its JSON answer into the terminal instead of writing `.agent-done` no longer throws the whole run away. For these task types the sentinel JSON *is* the deliverable — a Layered Intelligence proposal becomes a filed tracker issue — so a weaker (typically local) model answering in the TUI rather than through the tool call meant the hook ran with no payload and minutes of reasoning were discarded silently. When no sentinel was written, finalize now scans the ANSI-stripped tail of the run's PTY transcript for the newest complete JSON object and adopts it only if the owning hook's own shape predicate accepts it, logging the rescue so a salvaged run stays distinguishable from a clean one. Scoped to programmatic-I/O types on purpose: everywhere else the sentinel is a completion signal, not a product, and scraping a transcript for one would let an agent that merely discussed finishing be counted as finished.+- **Chief of Staff now exposes its persistent Pause/Resume control in the UI.** Stop only tears down the current daemon process; an always-on install can start it again, which made supervised live work a race against unrelated queued agents. The header now separates queue control from process control: Pause keeps CoS healthy but blocks new task evaluation and dispatch across restarts, Resume explicitly reopens the queue, and Stop remains available as the full shutdown. The pause copy also makes clear that already-running agents are not killed, so their work can be paused individually and preserved from the Agents tab.+## Privacy Center- **Your PII vault stays on one machine — permanently, by decision.** The Privacy Center's vault, organization registry, change-of-address inventory and broker opt-out ledger were always machine-local, but that was recorded as a feature not yet built, which left the door open to syncing them to your other PortOS machines later. It is now a documented guarantee: none of it federates, and none of it ever will without a new decision record superseding this one. The reasoning is written up in full — chiefly that PortOS's peer-sync was built for creative work rather than identity data, that the display masks (`••••1234`, `j•••@example.com`) are readable even when the underlying values are encrypted, and that copying one encryption key to several machines would widen the exposure of every one of them. If you want the vault on a second machine, restore a backup and copy the key by hand — a deliberate act, rather than something that happens quietly in the background. Managing PII for other household members is unaffected and remains planned.diff --git a/client/src/components/cos/StatusIndicator.jsx b/client/src/components/cos/StatusIndicator.jsxindex e2601422f8..0cee96ccc5 100644--- a/client/src/components/cos/StatusIndicator.jsx+++ b/client/src/components/cos/StatusIndicator.jsx@@ -1,12 +1,19 @@-export default function StatusIndicator({ running }) {+export default function StatusIndicator({ running, paused = false }) {+ const label = !running ? 'Stopped' : paused ? 'Paused' : 'Running';+ const tone = !running+ ? 'bg-gray-700 text-gray-400'+ : paused+ ? 'bg-port-warning/20 text-port-warning'+ : 'bg-port-success/20 text-port-success';+ const dot = !running+ ? 'bg-gray-500'+ : paused+ ? 'bg-port-warning'+ : 'bg-port-success animate-pulse';return (- <div className={`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm ${- running- ? 'bg-port-success/20 text-port-success'- : 'bg-gray-700 text-gray-400'- }`}>- <span className={`w-2 h-2 rounded-full ${running ? 'bg-port-success animate-pulse' : 'bg-gray-500'}`} />- {running ? 'Running' : 'Stopped'}+ <div className={`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm ${tone}`}>+ <span className={`w-2 h-2 rounded-full ${dot}`} />+ {label}</div>);}diff --git a/client/src/pages/ChiefOfStaff.jsx b/client/src/pages/ChiefOfStaff.jsxindex a645fc2340..ed3a13b9f3 100644--- a/client/src/pages/ChiefOfStaff.jsx+++ b/client/src/pages/ChiefOfStaff.jsx@@ -5,7 +5,7 @@ import { useLocalStorageBool } from '../hooks/useLocalStorageBool';import { useAutoRefetch } from '../hooks/useAutoRefetch';import { useValidTab } from '../hooks/useValidTab';import * as api from '../services/api';-import { Play, Square, Clock, CheckCircle, AlertCircle, Cpu, ChevronDown, ChevronUp, ChevronLeft, ChevronRight, Brain, PanelLeftClose, PanelLeftOpen } from 'lucide-react';+import { Play, Pause, Square, Clock, CheckCircle, AlertCircle, Cpu, ChevronDown, ChevronUp, ChevronLeft, ChevronRight, Brain, PanelLeftClose, PanelLeftOpen } from 'lucide-react';import toast from '../components/ui/Toast';import BrailleSpinner from '../components/BrailleSpinner';import TabPills from '../components/ui/TabPills';@@ -118,6 +118,7 @@ export default function ChiefOfStaff() {// Derive agent state from system statusconst deriveAgentState = useCallback((statusData, agentsData, healthData) => {if (!statusData?.running) return 'sleeping';+ if (statusData.paused) return 'sleeping';const activeAgents = agentsData.filter(a => a.status === 'running');if (activeAgents.length > 0) return 'coding';@@ -176,7 +177,9 @@ export default function ChiefOfStaff() {const newState = deriveAgentState(statusData, agentsData, healthData);setAgentState(newState);// Use default state message - real messages come from socket events- setStatusMessage(STATE_MESSAGES[newState]);+ setStatusMessage(statusData?.paused+ ? `Paused${statusData.pauseReason ? ` — ${statusData.pauseReason}` : ''}`+ : STATE_MESSAGES[newState]);// Set active agent metadata for dynamic avatar (use first running agent)const runningAgent = agentsData.find(a => a.status === 'running');@@ -374,6 +377,35 @@ export default function ChiefOfStaff() {}};+ const handlePause = async () => {+ const reason = 'Paused from Chief of Staff controls';+ const result = await api.pauseCos(reason, { silent: true }).catch(err => {+ toast.error(err.message);+ return null;+ });+ if (result?.success) {+ toast.success('Chief of Staff paused');+ setStatus(prev => ({ ...prev, paused: true, pausedAt: result.pausedAt, pauseReason: reason }));+ setAgentState('sleeping');+ setStatusMessage(`Paused — ${reason}`);+ fetchData();+ }+ };++ const handleResume = async () => {+ const result = await api.resumeCos({ silent: true }).catch(err => {+ toast.error(err.message);+ return null;+ });+ if (result?.success) {+ toast.success('Chief of Staff resumed');+ setStatus(prev => ({ ...prev, paused: false, pausedAt: null, pauseReason: null }));+ setAgentState('thinking');+ setStatusMessage('Resuming daemon - scanning for tasks...');+ fetchData();+ }+ };+const handleForceEvaluate = async () => {// Only announce success / drive the "thinking" state after the request// actually resolves — a failed evaluate must not flash a success toast.@@ -547,18 +579,41 @@ export default function ChiefOfStaff() {</div></button>{status?.running ? (- <button- type="button"- onClick={handleStop}- className="bg-port-error/20 hover:bg-port-error/30 text-port-error border border-port-error/30 rounded px-2 py-1.5 flex items-center gap-2 transition-colors min-h-[52px]"- aria-label="Stop Chief of Staff agent"- >- <Square size={16} className="shrink-0" aria-hidden="true" />- <div className="flex-1 min-w-0 text-left">- <div className="text-[10px] text-gray-600">Agent</div>- <div className="text-sm font-bold text-port-error">Stop</div>- </div>- </button>+ <>+ <button+ type="button"+ onClick={status.paused ? handleResume : handlePause}+ className={`border rounded px-2 py-1.5 flex items-center gap-2 transition-colors min-h-[52px] ${+ status.paused+ ? 'bg-port-success/20 hover:bg-port-success/30 text-port-success border-port-success/30'+ : 'bg-port-warning/20 hover:bg-port-warning/30 text-port-warning border-port-warning/30'+ }`}+ aria-label={status.paused ? 'Resume Chief of Staff scheduling' : 'Pause Chief of Staff scheduling'}+ title={status.paused+ ? 'Resume task evaluation and dispatch'+ : 'Pause new task evaluation and dispatch; running agents keep their work'}+ >+ {status.paused+ ? <Play size={16} className="shrink-0" aria-hidden="true" />+ : <Pause size={16} className="shrink-0" aria-hidden="true" />}+ <div className="flex-1 min-w-0 text-left">+ <div className="text-[10px] text-gray-600">Queue</div>+ <div className="text-sm font-bold">{status.paused ? 'Resume' : 'Pause'}</div>+ </div>+ </button>+ <button+ type="button"+ onClick={handleStop}+ className="bg-port-error/20 hover:bg-port-error/30 text-port-error border border-port-error/30 rounded px-2 py-1.5 flex items-center gap-2 transition-colors min-h-[52px]"+ aria-label="Stop Chief of Staff agent"+ >+ <Square size={16} className="shrink-0" aria-hidden="true" />+ <div className="flex-1 min-w-0 text-left">+ <div className="text-[10px] text-gray-600">Agent</div>+ <div className="text-sm font-bold text-port-error">Stop</div>+ </div>+ </button>+ </>) : (<buttontype="button"@@ -676,7 +731,7 @@ export default function ChiefOfStaff() {>CoS</h1>- <StatusIndicator running={status?.running} />+ <StatusIndicator running={status?.running} paused={status?.paused} /></div><div className="flex items-center gap-1.5 text-gray-400"><StateLabel state={agentState} compact />@@ -727,7 +782,7 @@ export default function ChiefOfStaff() {>CoS</h1>- <StatusIndicator running={status?.running} />+ <StatusIndicator running={status?.running} paused={status?.paused} /></div><div className="flex items-center gap-1.5 text-gray-400"><StateLabel state={agentState} compact />diff --git a/client/src/pages/ChiefOfStaff.test.jsx b/client/src/pages/ChiefOfStaff.test.jsxindex 5f46dde810..46ebc553d1 100644--- a/client/src/pages/ChiefOfStaff.test.jsx+++ b/client/src/pages/ChiefOfStaff.test.jsx@@ -16,6 +16,8 @@ const api = vi.hoisted(() => ({getCosActionableInsights: vi.fn(),getCosBudgetUsage: vi.fn(),forceCosEvaluate: vi.fn(),+ pauseCos: vi.fn(),+ resumeCos: vi.fn(),forceHealthCheck: vi.fn(),updateCosConfig: vi.fn(),// HealthTab (rendered by the manual "Run Check" test) + its ProviderStatusCard.@@ -71,6 +73,8 @@ beforeEach(() => {api.getCosLearning.mockResolvedValue(null);api.getProviderStatuses.mockResolvedValue({ providers: {} });api.getCosBudgetUsage.mockResolvedValue({ usage: {} });+ api.pauseCos.mockResolvedValue({ success: true, pausedAt: '2026-01-01T00:00:00.000Z' });+ api.resumeCos.mockResolvedValue({ success: true });});const renderConfigTab = () => render(@@ -113,6 +117,39 @@ describe('ChiefOfStaff handleForceEvaluate', () => {});});+describe('ChiefOfStaff daemon pause controls', () => {+ it('pauses new CoS scheduling through the persistent pause API', async () => {+ api.getCosStatus.mockResolvedValue({ running: true, paused: false, config, stats: {} });+ renderConfigTab();++ fireEvent.click((await screen.findAllByRole('button', { name: /pause chief of staff scheduling/i }))[0]);++ await waitFor(() => expect(api.pauseCos).toHaveBeenCalledWith(+ 'Paused from Chief of Staff controls',+ { silent: true },+ ));+ expect(toast.success).toHaveBeenCalledWith('Chief of Staff paused');+ });++ it('resumes task dispatch only from an explicit Resume action', async () => {+ api.getCosStatus.mockResolvedValue({+ running: true,+ paused: true,+ pauseReason: 'Supervised maintenance',+ config,+ stats: {},+ });+ renderConfigTab();++ expect((await screen.findAllByText('Paused')).length).toBeGreaterThan(0);++ fireEvent.click((await screen.findAllByRole('button', { name: /resume chief of staff scheduling/i }))[0]);++ await waitFor(() => expect(api.resumeCos).toHaveBeenCalledWith({ silent: true }));+ expect(toast.success).toHaveBeenCalledWith('Chief of Staff resumed');+ });+});+// The Learning stat card's skipped-count label used to sit in a `flex` row// beside the success-rate value. Flex items default to min-width:auto, so on a// narrow (mobile) card the label could not shrink below its min-content widthdiff --git a/client/src/services/apiAgents.js b/client/src/services/apiAgents.jsindex 260207b5e9..841195e803 100644--- a/client/src/services/apiAgents.js+++ b/client/src/services/apiAgents.js@@ -39,9 +39,10 @@ export const getAgentActivityStats = (agentId, days = 7) =>export const getCosStatus = () => request('/cos');export const startCos = (options = {}) => request('/cos/start', { method: 'POST', ...options });export const stopCos = (options = {}) => request('/cos/stop', { method: 'POST', ...options });-export const pauseCos = (reason) => request('/cos/pause', {+export const pauseCos = (reason, options = {}) => request('/cos/pause', {method: 'POST',- body: JSON.stringify({ reason })+ body: JSON.stringify({ reason }),+ ...options,});export const resumeCos = (options = {}) => request('/cos/resume', { method: 'POST', ...options });export const getCosConfig = (options) => request('/cos/config', options);