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

refactor([issue-1840]): apply /simplify findings — sseUtils SSE_HEADERS reuse, inline wrapper

[._.]/ Adam Eivyf695d758fd54
diff --git a/client/src/pages/AgentsPage.jsx b/client/src/pages/AgentsPage.jsx
index 3bb7398e34..bb3784804a 100644
--- a/client/src/pages/AgentsPage.jsx
+++ b/client/src/pages/AgentsPage.jsx
@@ -28,10 +28,6 @@ export function AgentsPage() {
setExpandedPid(prev => prev === pid ? null : pid);
};
- const formatStartTime = (timestamp) => {
- return formatDateTime(timestamp);
- };
-
const totalCpu = agents.reduce((sum, a) => sum + (a.cpu || 0), 0);
const totalMemory = agents.reduce((sum, a) => sum + (a.memory || 0), 0);
@@ -240,7 +236,7 @@ export function AgentsPage() {
</div>
<div>
<div className="text-xs text-gray-500 uppercase tracking-wide mb-1">Started At</div>
- <div className="text-sm text-gray-300">{formatStartTime(agent.startTime)}</div>
+ <div className="text-sm text-gray-300">{formatDateTime(agent.startTime)}</div>
</div>
<div>
<div className="text-xs text-gray-500 uppercase tracking-wide mb-1">Runtime (ms)</div>
diff --git a/server/lib/sseUtils.js b/server/lib/sseUtils.js
index 6dcfde87c5..dc64001fb7 100644
--- a/server/lib/sseUtils.js
+++ b/server/lib/sseUtils.js
@@ -9,6 +9,7 @@
// fire-and-forget coordinator shape.
import { randomUUID } from 'crypto';
+import { SSE_HEADERS } from './sseDownload.js';
// Filters Python child noise (HF/torch/bitsandbytes/xformers warnings, deprecation
// notices, etc.) that would otherwise drown the user's view of real progress.
@@ -38,11 +39,7 @@ export const broadcastSse = (job, payload) => {
export const attachSseClient = (jobs, jobId, res) => {
const job = jobs.get(jobId);
if (!job) return false;
- res.writeHead(200, {
- 'Content-Type': 'text/event-stream',
- 'Cache-Control': 'no-cache',
- Connection: 'keep-alive',
- });
+ res.writeHead(200, SSE_HEADERS);
job.clients.push(res);
// Replay the last broadcasted frame so a client that connected after a
// `complete`/`error` (within the SSE_CLEANUP_DELAY_MS grace window) sees
diff --git a/server/services/writersRoom/local.js b/server/services/writersRoom/local.js
index 9074aa0347..3537179e72 100644
--- a/server/services/writersRoom/local.js
+++ b/server/services/writersRoom/local.js
@@ -28,9 +28,11 @@ const store = () => writersRoomStore();
// ---------- text analysis ----------
-// `countWords` now lives in lib/textUtils.js (the canonical home that
-// issueLength.js and the editorial checks also share). Re-exported here so
-// existing importers of this module keep working unchanged.
+// `countWords` now lives in lib/textUtils.js (the canonical home it shares with
+// issueLength.js). Re-exported here so existing importers of this module keep
+// working unchanged. (The editorial checks keep their own copies on purpose:
+// checkInfra.js uses a different alphabetic-only tokenizer, and
+// letteringDensity.js is held byte-for-byte in sync with its client mirror.)
export { countWords };
export function contentHash(text) {