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([subagent-spawner-top-level-side-effects]): remove from PLAN.md and log to changelog

[._.]/ Adam Eivy9372a4fc943d
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 396e996b4e..7c455b4837 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -35,6 +35,7 @@
- **[setup-data-import-drift-tables-from-migrations]** The setup script's "a prompt migration is pending" warning now derives its hash tables directly from the migration files instead of a hand-maintained copy, so the warning can't silently fall out of sync when a new prompt migration ships (no user-facing change).
- **[cos-on-demand-mark-app-review-started-dedupe]** When several on-demand improvement requests for the same app are processed in one CoS dispatch cycle, the app's activity record is now marked review-started once instead of once per request (no user-facing change).
- **[cos-agent-output-write-amplification] Streamed CoS agent output no longer rewrites the entire agent-state file once per line.** A shared ~250ms output batcher now coalesces the runner's per-line output events and direct-CLI stdout/stderr into single state writes (draining before an agent is marked complete), cutting agent-state write churn on chatty agents from dozens of writes/sec to a few — with no change to the live output tail (no user-facing change).
+- **[subagent-spawner-top-level-side-effects]** The CoS agent spawner now initializes explicitly at server startup instead of as a side effect of being imported, so importing it (in tests or elsewhere) no longer re-arms its event listeners and timers (no user-facing change).
## Fixed
diff --git a/PLAN.md b/PLAN.md
index 5f4573aed2..3cbbe8ff31 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -7,7 +7,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel
Claimable, well-specified, no decision needed — `/claim`-able. Unordered.
- [ ] [shared-tolerant-fetch-json-helper] **Extract a shared tolerant `response.text()`→JSON parser and adopt it across the other fetch-based clients.** `cosRunnerClient.js` now reads runner bodies via a local `readRunnerJson` (delegating to `safeJSONParse`) so a non-JSON error page no longer crashes with `Unexpected token <`. The same unguarded `await response.json()` crash risk remains in other fetch-based clients: `server/lib/aiProvider.js` (~146), `server/services/browserService.js` (~111/207/216/269/291), `server/services/memoryEmbeddings.js`, `huggingFaceCatalog.js`, `messageTokenExtractor.js`, `ollamaManager.js`, and `server/lib/aiToolkit/providers.js` (the `.catch(() => ({ data: [] }))` band-aids). Promote a `fetchJsonTolerant(response)` / `readResponseJson(response)` helper (adjacent to `server/lib/fetchWithTimeout.js`, registered in the lib barrel + README) and migrate these call sites. Deferred from the `[cos-runner-client-non-json-response-handling]` PR (out of its stated single-file scope); surfaced by /simplify altitude (2026-06-01).
-- [ ] [subagent-spawner-top-level-side-effects] **`subAgentSpawner.js` top-level side effects — move init into an explicit `initSpawner()`.** Module-load (`server/services/subAgentSpawner.js:153`) wires event listeners + timers, which interferes with test isolation (each test import re-arms them). Wrap the init block in `export function initSpawner()` and call it from `server/index.js` after dependencies are ready. Treat as a refactor — needs care that no consumer relies on the import-time wiring.
- [ ] [conflict-journal-media-collections] **Conflict journal does not cover media-collection scalar overwrites.** `mergeMediaCollectionsFromSync` (`server/services/mediaCollections.js`) LWW-overwrites scalars (name/description/coverKey/universeId/seriesId) when `remoteWins`; items are union-merged (never lost). v1 hooks only universe + series merges because the whole-record content hash used by `conflictJournal.detectConflict` would false-positive on collections whenever items differ. Doing it right needs scalar-subset hashing that stays consistent with the sender-side base hash. Low value (scalar loss is minor), deferred.
- [ ] [conflict-journal-issues] **Issue-level conflict journaling.** The share-bucket importer hook (`server/services/sharing/importer.js` `applyAutoMerge`→`mergeOne`) is gated to `universe`/`series`; child issues ride LWW silently. Extend the journal to issues (needs the issue merge path to thread a `source` + call `maybeJournalBeforeOverwrite`).
- [ ] [conflict-journal-deep-diff] **`diffSummary` is top-level shallow only.** `conflictJournal.diffSummary` compares top-level fields via canonicalStringify, so the UI shows "categories differ" rather than which variation/canon entry changed. Add per-field deep diffing for richer InlineDiff rendering in the Conflicts tab.