Skip to content

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

docs([issue-1840]): log issue #1840 to changelog

[._.]/ Adam Eivy37dbb579cf1a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 240e7ad56a..dedee6c526 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -36,6 +36,7 @@
## Internal
+- **[issue-1840] Adopted canonical client hooks/utils + deduped `countWords`** — replaced hand-rolled duplicates of existing helpers across the codebase. `countWords` was re-implemented in `server/lib/issueLength.js` and `server/services/writersRoom/local.js`; both now import the new canonical `server/lib/textUtils.js` (the client `formatters.js` mirror is documented against it). Six services that open-coded `mkdir(dir, { recursive: true })` now use `lib/fileUtils.js` `ensureDir` (which swallows the spurious Windows EEXIST/EPERM the raw call doesn't). The `logs` and `openclaw` SSE routes route their response-header boilerplate through `openSseStream`, and `X-Accel-Buffering: no` moved into the shared `SSE_HEADERS` (so every SSE consumer disables proxy buffering). On the client, ~44 `new Date(x).toLocaleString()` display sites now use the canonical `formatDateTime` for consistent date formatting, and several hand-rolled single-armed-row delete confirmations / saving-flag patterns adopt the `useConfirmDelete` / `useAsyncAction` hooks. (#1840)
- **[issue-1841] Stopped silently swallowing errors** — replaced `.catch(() => {})` / bare `catch {}` swallows that discarded failures with no log or user signal. The recovery-critical completion writes in `cos-runner/index.js` (output.txt + completion metadata) now log a `console.error` on failure instead of silently dropping a finished task, and `telegramClient.js`'s poll loop logs non-abort errors (JSON/Type errors that were previously retried blind) before retrying. On the client, the silent initial-load `.catch(() => {})` swallows in `ToolsTab.jsx` (rate-limit / submolt / draft refreshes), the `loraTraining/*` pickers (`CharacterLoraChip`, `TrainingPanel`, `LiveSampleGallery`, `CheckpointPicker`, `ImportGalleryDialog`, `UniverseCharacterPicker`), and `meatspace/post/*` (`MemoryBuilder`, `MemoryPractice`, `PostHistory`, `PostDrillConfig`, `PostSessionLauncher`, `ElementsSong`) now `console.warn` the error while keeping their zero-state fallbacks, so a failed load is visible in the console instead of a silent empty state. (#1841)
- **[issue-1843] Logging hygiene: single-line interpolated logs + `parseInt` radix** — enforced the single-line-log convention across a handful of stragglers flagged by the `/do:better` audit. `useErrorNotifications.js` passed `error.context` as a raw object arg to `console.warn/error` (expanding a multi-field console group); it now interpolates the context as a single-line JSON suffix via a shared `formatContext` helper. `routes/database.js` had an embedded `\n` that split a failed-command log into two records — the detail is now whitespace-collapsed onto one line. The per-request route-path `console.log`s in `routes/agentActivity.js`, `routes/platformAccounts.js`, and `routes/agentPersonalities.js` (pure noise — mutations already persist via `logAction`) were removed. And `routes/digital-twin.js`'s `parseInt(req.query.limit)` gained its missing radix `10`. No behavior change beyond log formatting. (#1843)