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
Merge pull request #2694 from atomantic/cos/task-mrnwtqz4/agent-d09c893a
[._.]/ Adam Eivy025e4e055f21
diff --cc .changelog/NEXT.mdindex e30565ac4a,f24606182b..aeb32cf24b--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@@ -61,10 -59,10 +61,12 @@@## Fixed+- **Updating/reconciling no longer severs a live CoS agent.** The update page's "Update Now", "Reconcile Now", and every fork *update* variant run `update.sh`, which pm2-restarts PortOS — killing any CoS agent mid-task (each agent's PTY/child process is a child of the server process). The Update tab now suppresses the "Install out of sync" reconcile prompt and the restart-triggering update buttons while agents are running, showing a "Update paused — CoS agents running" notice that clears automatically once the last agent finishes (the tab polls status every 4s while agents are live). Safe, non-restarting actions stay available — "Sync Fork Only" (just `gh repo sync`) and "Ignore v…" are not hidden. Defense-in-depth on the server: `POST /api/update/execute` hard-rejects with `409 AGENTS_ACTIVE` when agents exist, so a race, a stale client, or a direct API call can't restart out from under a running agent — and it re-checks once more *after* acquiring the update lock (releasing it on abort) so an agent that goes live during the git/fork work still blocks the restart. The active-agent signal counts the in-memory live-process maps (direct + runner spawns) **plus in-flight spawns** (`spawningTasks`) — a just-launched agent whose child process exists but isn't yet registered in a process map would otherwise be invisible to a plain live-process check and still get severed. A stale persisted `status: 'running'` can't spuriously block, and a paused agent (process already stopped) correctly doesn't. `GET /api/update/status` reports `activeCosAgents`, and the tab keeps a light status poll running whenever an update/reconcile surface is on screen, so an agent that starts (from a schedule or another tab) suppresses the buttons promptly rather than leaving one that 409s on click. Covered by `update.test.js` and `UpdateTab.test.jsx`.+- **[issue-2681] POST daily status now uses your timezone, not the server's UTC day.** `completedToday`, `todayScore`, and the POST streaks in the MeatSpace POST service derived the day boundary from the server's UTC day (the process runs `TZ=UTC`), so for anyone outside UTC a POST completed the previous local evening could read as "done today," or a just-completed local-day POST could read as incomplete — and the Daily Post widget and the Daily Driver card (#2666), which both render `completedToday` from `getPostStats()`, inherited the drift. The day boundary now threads your configured timezone (`getUserTimezone`/`todayInTimezone`, via a shared `userLocalToday()` helper) through both sides: every writer that stamps a day (`submitPostSession`, `submitTrainingEntry`, memory-practice `submitPractice`, and Morse `appendMorseRound`) records a new record's `date` in your local day — derived from the same instant it stamps into `timestamp`/`startedAt` so a midnight boundary can't split the two — and every reader (`getPostStats`/`getPostProgress`/`getUnifiedActivityStreak`/`getTrainingStats`/`getMorseProgress`, plus the mastery-window cutoffs) derives "today" in your local day, mirroring the Daily Driver's tz-correct first-visit/handled markers so every surface agrees. All window cutoffs use DST-safe day math off the local today. The POST launcher's "completed today"/today's-minutes and the history range floor also derive their day key in your configured timezone (new `useUserTimezone` hook + `dayKeyInTimezone` util) so the client agrees with the server instead of computing "today" in UTC. A one-time migration (`192-post-dates-to-local-timezone`) re-derives existing session, training-log, and Morse-round day-strings from each record's stored UTC timestamp in your timezone (preferring the retry-stable `startedAt`, and preserving a legacy practice entry's only instant into `timestamp` before rewriting `date`), so historical streaks stay correct and don't collide with newly-written local-day records; it falls back to UTC (matching the server's `TZ=UTC` runtime), making it a no-op for UTC/unconfigured installs.+ - **Proactive voice speech no longer plays on every open tab/device at once.** Server-initiated voice lines (reminders, briefings, task-completion alerts) were broadcast with `io.emit('voice:speak', …)`, so every browser tab and every device connected to the instance spoke the same line simultaneously. Proactive audio is now routed to a single designated recipient tab, mirroring the shell's single-attached-socket pattern (new `server/services/voice/voiceOutput.js`): each tab registers as a candidate on connect, and the tab you're actively looking at claims output — the client emits `voice:output:claim` on focus, on becoming visible, and on reconnect-while-visible. When the recipient tab disconnects, output is promoted to the tab you focused most recently so audio always has exactly one home. Per-turn TTS (`voice:tts:audio`) was already single-socket and is unaffected. The voice widget shows a **speaker / muted** control so you can see which tab is the speaker and click to move it to the current tab. (Scope: dedup is per-instance — every client of one PortOS instance; it does not coordinate proactive lines independently fired by separate federated peers.)+- **[issue-2567] Stop double error toasts across the Settings tabs and the JIRA integration page.** Several Settings surfaces routed a request through the auto-toasting `request()` helper AND showed their own `toast.error` in a custom catch, so a failure stacked two toasts. Every such call now passes `{ silent: true }` so the caller's catch is the single error layer — covering VoiceTab (config load/save, Piper voice download), ImageGenTab (settings/tools load, save, tool register/update, test render), TelegramTab (settings load, method/config/test/disconnect, forward-types), BackupTab (settings load + save), DatabaseTab (status load), EmbeddingsTab (save), MortalLoomTab and CaptionModelPicker (save), and the JIRA instances page (load/save/delete/test — mirroring the DataDog fix from #2520). Loaders and callers without a custom toast are unchanged (single default-helper layer preserved). The `getVoiceConfig`/`updateVoiceConfig`/`fetchPiperVoice`, telegram, `registerTool`/`updateTool`/`getToolsList`, and `getDatabaseStatus` wrappers gained a backward-compatible trailing `options` param so callers can opt into silent. Follow-up sweep of the remaining pipeline/writers-room/universe/media/etc. areas is tracked in #2669.- **[issue-2669] Stop double error toasts across the writers-room, universe, digital-twin, media, and brain areas.** Continues the #2567 sweep into the non-settings feature areas: every caller that showed its own `toast.error` in a custom `.catch`/`catch` while its API call also routed through the auto-toasting `request()` helper now passes `{ silent: true }`, so a failure surfaces one toast instead of two stacked ones. Covered across writers-room (folders/works/characters/objects/places CRUD, exercises, polish, drafts, analysis, promote-to-pipeline), universe canon + universeBuilder (extract/differentiate/refine/expand, lock toggles, world/reference-sheet renders, draft save + expand/refine auto-saves), digital-twin (confidence, enrichment lists, autobiography, writing-style/import/assessment analysis, taste + behavioral feedback, soul tests/documents), media/image/video (collections, timeline projects, media jobs queue, gallery hide/clean/upscale/stitch, image-gen cancel + submit, annotations, last-frame extract), and brain (links, daily log, brain graph). Loaders and callers without a custom toast are unchanged (single default-helper layer preserved). Wrappers in `apiWritersRoom.js`, `apiUniverseBuilder.js`, `apiDigitalTwin.js`, `apiImageVideo.js`, `apiMediaJobs.js`, and `apiBrain.js` gained a backward-compatible trailing `options` param so callers can opt into silent. Pipeline toast sites are intentionally deferred (a concurrent PR is reworking `client/src/**/pipeline/**`) and remain tracked in #2669, along with the other still-unswept areas (apps, cos, messages, meatspace, sharing, music/songs, privacy, calendar, and misc pages).