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
fix: stop migrating legacy autoClean=true into denoise=true on upgrade
[._.]/ Adam Eivy26ecdc32aa16
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 5d81d90d67..d3748919fb 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -39,5 +39,6 @@- **Migration 003 no longer crashes `update.sh` when a stage prompt was renamed upstream.** `pipeline-tv-script.md` was renamed to `pipeline-teleplay.md` in a later commit, leaving older installs unable to run migration 003 (ENOENT on the missing sample file). The migration now treats a sample-side rename/retirement as a soft delete: unmodified copies of the old file are removed cleanly, customized copies emit a warning so edits can be merged into the replacement manually.- **[agent-spawn-widen-try-finally-guard] A failed agent spawn no longer permanently blocks the task that triggered it.** Previously, when an agent failed to start due to a transient I/O or disk error mid-setup, the autonomous task scheduler could enter a state where that specific task was treated as "already spawning" forever and was silently skipped until the server restarted. Now any such failure releases the in-flight guard immediately so the next scheduler tick can retry the task.- **[queueEligibleImprovementTasks-route-through-rich-generator] Auto-queued `plan-task` and `feature-ideas` agents pick distinct PLAN.md slugs again — no more duplicate PRs against the same item.** The scheduler's queue path (`sys-*` task ids) was writing a one-line stub description and skipping the rich generator entirely, so the agent it dispatched had no `analysisType`/`planId` metadata and no Phase 1-7 instructions — the in-flight scan (`git branch -a` + `gh pr list` matching documented `claim/<slug>` / `cos/<task>/<slug>/<agent>` refs) never ran. Two `plan-task` agents 2h apart could both pick the same slug; the second branched as `worktree-<slug>` and opened an overlapping PR for already-claimed work. The queue path now routes through `generateManagedAppImprovementTaskForType` so `applyPlanIdMetadata` pre-picks the planId (and silently skips when every slug is blocked or already in flight) and the agent receives the full prompt template with `{planConstraint}` substituted. Regression-pinned in `services/cos.test.js`.+- **Upgrading users with legacy `autoClean: true` no longer silently inherit denoise.** Before the cleanC2PA / denoise split, image-gen settings carried a single `autoClean` flag, and the resolver mapped a pre-split `autoClean: true` into BOTH new flags — meaning anyone who'd opted into auto-cleaning before the split was still getting the lossy median+sharpen pass on every render, even though the Settings UI defaults denoise off for everyone else. `resolveCleanersFromConfig` (server + client mirror) now defaults denoise to `false` unconditionally; legacy `autoClean: true` continues to imply `cleanC2PA: true` (which defaults on regardless) but no longer turns on denoise. Users who want denoise back can toggle it per-provider in Settings → Image Gen.## Removeddiff --git a/client/src/lib/imageCleaners.js b/client/src/lib/imageCleaners.jsindex 23507b93a5..6115bd6df8 100644--- a/client/src/lib/imageCleaners.js+++ b/client/src/lib/imageCleaners.js@@ -1,14 +1,14 @@// Client mirror of `resolveCleanersFromConfig` from `server/lib/imageClean.js`.// The server is authoritative — keep the two copies in sync. Used by the// Settings ImageGenTab and the per-render ImageGen page so both surfaces-// agree on how the saved per-mode settings map into the two-flag world,-// including the legacy `autoClean: true` → both-flags migration.+// agree on how the saved per-mode settings map into the two-flag world.+// Legacy `autoClean: true` no longer carries into denoise — upgrading users+// who never explicitly chose denoise get it off (it's lossy and blurs text).export function resolveCleanersFromConfig(modeCfg) {const cfg = modeCfg || {};- const legacy = cfg.autoClean === true;return {cleanC2PA: typeof cfg.cleanC2PA === 'boolean' ? cfg.cleanC2PA : true,- denoise: typeof cfg.denoise === 'boolean' ? cfg.denoise : legacy,+ denoise: typeof cfg.denoise === 'boolean' ? cfg.denoise : false,};}diff --git a/server/lib/imageClean.js b/server/lib/imageClean.jsindex 35b71efe20..9e6bd2a406 100644--- a/server/lib/imageClean.js+++ b/server/lib/imageClean.js@@ -23,20 +23,20 @@ import { tryReadFile, safeJSONParse, atomicWrite } from './fileUtils.js';* "what did the user save" rule that resolver + Settings UI + ImageGen* page + test mocks all need to agree on).*- * Migration: legacy `autoClean: true` (single boolean, pre-split) maps to- * BOTH new flags. Users who opted into denoising before the split don't- * silently lose it on upgrade. `cleanC2PA` defaults to true (safe, lossless);- * `denoise` defaults to false (lossy, blurs text).+ * Defaults: `cleanC2PA` defaults to true (safe, lossless); `denoise` defaults+ * to false (lossy, blurs text — must be explicitly opted into). Legacy+ * pre-split installs carrying `autoClean: true` keep `cleanC2PA` on (which+ * defaults on anyway) but do NOT silently inherit denoise — upgrading users+ * who never explicitly chose denoise get it off.** Mirrored verbatim in `client/src/lib/imageCleaners.js` — keep the two* copies in sync; the client tree can't import from server/lib.*/export function resolveCleanersFromConfig(modeCfg) {const cfg = modeCfg || {};- const legacy = cfg.autoClean === true;return {cleanC2PA: typeof cfg.cleanC2PA === 'boolean' ? cfg.cleanC2PA : true,- denoise: typeof cfg.denoise === 'boolean' ? cfg.denoise : legacy,+ denoise: typeof cfg.denoise === 'boolean' ? cfg.denoise : false,};}diff --git a/server/routes/imageGen.test.js b/server/routes/imageGen.test.jsindex 446a5a7a75..c3b2318c4f 100644--- a/server/routes/imageGen.test.js+++ b/server/routes/imageGen.test.js@@ -13,12 +13,12 @@ vi.mock('../services/imageGen/index.js', () => ({IMAGE_GEN_MODES: ['external', 'local', 'codex'],// Mirror the real precedence by delegating to the same helper the prod// resolver uses — keeps test mock and prod in lock-step automatically.+ // Legacy `autoClean: true` no longer carries into denoise (lossy, opt-in only).resolveImageCleaners: (body, settings, mode) => {const cfg = settings?.imageGen?.[mode] || {};- const legacy = cfg.autoClean === true;const saved = {cleanC2PA: typeof cfg.cleanC2PA === 'boolean' ? cfg.cleanC2PA : true,- denoise: typeof cfg.denoise === 'boolean' ? cfg.denoise : legacy,+ denoise: typeof cfg.denoise === 'boolean' ? cfg.denoise : false,};return {cleanC2PA: typeof body?.cleanC2PA === 'boolean' ? body.cleanC2PA : saved.cleanC2PA,@@ -395,10 +395,11 @@ describe('Image Gen Routes', () => {expect(imageGen.generateImage).toHaveBeenCalledWith(expect.objectContaining({ cleanC2PA: true, denoise: false }));});- it('legacy autoClean=true on settings maps to BOTH new flags on read', async () => {- // Pre-split installs persisted `autoClean: true`. resolveImageCleaners- // maps that to cleanC2PA=true + denoise=true so the user's opt-in- // behavior is preserved through the upgrade.+ it('legacy autoClean=true on settings does NOT silently enable denoise on read', async () => {+ // Pre-split installs persisted `autoClean: true`. We no longer carry+ // that into denoise — denoise is lossy (blurs text) and must be an+ // explicit opt-in. Upgrading users get cleanC2PA on (it defaults on+ // anyway) and denoise off until they explicitly toggle it.getSettings.mockResolvedValueOnce({imageGen: { mode: 'external', external: { autoClean: true } },});@@ -406,7 +407,7 @@ describe('Image Gen Routes', () => {await request(app).post('/api/image-gen/generate').send({ prompt: 'p' });- expect(imageGen.generateImage).toHaveBeenCalledWith(expect.objectContaining({ cleanC2PA: true, denoise: true }));+ expect(imageGen.generateImage).toHaveBeenCalledWith(expect.objectContaining({ cleanC2PA: true, denoise: false }));});it('legacy autoClean=true on body maps to BOTH new flags via the coerceFormFields shim', async () => {