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([media-job-sse-transient-reconnect-resilience]): remove from PLAN.md and log to changelog

[._.]/ Adam Eivy1ef48c1cdb86
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 870efaa4dd..c0c4647a16 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -24,6 +24,7 @@
## Fixed
+- **[media-job-sse-transient-reconnect-resilience] A brief network blip mid-render no longer fails the whole image or video generation.** The live progress stream now distinguishes a transient connection hiccup — which the browser silently reconnects, picking up where the render left off — from a real disconnect, so a momentary Wi-Fi/Tailscale drop while a render is in flight no longer aborts it with a "Lost connection to server" error.
- **[ollama-context-truncation] Local-Ollama runs no longer silently truncate long prompts to ~4K tokens.** PortOS sends stage prompts to Ollama's OpenAI-compatible `/v1/chat/completions`, which defaults to a ~4K context window and silently drops anything past it — so whole-manuscript editorial passes (the completeness pass concatenates up to 200K chars ≈ 50K tokens) were really only reviewing the tail of the manuscript with no error raised. The toolkit runner now sends a per-request `num_ctx` when the provider config carries one (a new optional `numCtx` provider field, honored by Ollama and ignored by other OpenAI-style endpoints), and `ensureBackendProvider` defaults the Ollama provider to a generous window at boot (`OLLAMA_NUM_CTX` env override, default 32768). LM Studio is unaffected (it sets context at model load). Cloud providers were never affected. This is the urgent half of the editorial context work; the full context-window-aware full-manuscript↔chunked strategy is planned in `docs/plans/2026-05-31-context-aware-manuscript-editorial.md` (`[context-aware-editorial-budgeting]`).
- **[provider-fallback-model-leak] Falling back to another provider no longer leaks the primary's model id onto it.** When a stage's primary provider was unavailable (e.g. Codex benched after an OpenAI content-safety refusal), the model resolved against the primary — `codex-configured-default` — was carried verbatim onto the fallback provider, so the run logged `LM Studio/codex-configured-default` and then 400'd because LM Studio has no such model (and Claude Code rejected it the same way). `stageRunner` now re-resolves the model against the *fallback* provider (honoring its configured `fallbackModel`, else its own default / args-baked model) instead of forwarding the primary's resolved model, and the toolkit `createRun` run record + log line do the same.
- **[ltx2-fflf-skips-last-image-resize-when-both-frames-set] ltx2 FFLF now resizes both anchor frames.** The two-keyframe ltx2 FFLF path passes both `--image` and `--last-image` into `scripts/generate_ltx2.py`, but Video Gen only resized the start image when both anchors were present. The end frame could therefore reach `KeyframeInterpolationPipeline.generate_and_save()` at its original dimensions. `videoGen/local.js` now treats ltx2 true-FFLF as a real last-image consumer and runs the same ffmpeg resize/crop pass used for multi-keyframes, with a regression test asserting the helper receives resized start and end paths.
diff --git a/PLAN.md b/PLAN.md
index 0ccc323bd8..fb551a9f34 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -6,7 +6,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel
Claimable, well-specified, no decision needed — `/claim`-able. Unordered.
-- [ ] [media-job-sse-transient-reconnect-resilience] **Make `useMediaJobSse`'s `onerror` resilient to transient EventSource reconnects.** `client/src/hooks/useMediaJobSse.js` closes + rejects on every `onerror`, including the transient `readyState === CONNECTING` blips the browser would otherwise auto-retry. The declarative `useSseProgress.js` already does this correctly — it only treats `readyState === EventSource.CLOSED` as terminal. Mirror that: in the hook's `onerror`, only `close()` + `reject()` (+ `onConnectionError`) when `es.readyState === EventSource.CLOSED`, leaving CONNECTING errors to the browser's auto-reconnect (the server replays the job's last SSE payload on re-attach). Deferred from the `[unify-media-job-sse-hook-imagegen-videogen]` review (Claude, MEDIUM, non-blocking): doing it changes the *main* ImageGen/VideoGen generation paths too — they currently reject on any blip (preserved from the pre-refactor inline handlers) — so it's a deliberate behavior improvement, not a refactor-neutral change. The resume path's stuck-`generating` symptom is already patched via `onConnectionError`; this is the deeper fix.
- [ ] [banner-icon-aria-hidden] **Apply `aria-hidden="true"` to `<Banner>`'s rendered icon.** `client/src/components/ui/Banner.jsx` (~line 62) renders the `icon` prop as a bare `<Icon …>` — when the icon is decorative (the body text already conveys the meaning), screen readers should skip it. Either wrap the icon render in `<span aria-hidden="true">` inside Banner, or thread an `iconAriaHidden` prop. Once landed, re-migrate the `ImportTab.jsx` error row to `<Banner tone="error" size="md" icon={AlertCircle} actions={…}>` (it was reverted from `<Banner>` because the icon prop doesn't pass through a11y attributes).
- [ ] [inline-confirm-row-primitive] **Extract `<InlineConfirmRow tone="error">` primitive for inline delete-confirm rows.** Five sites (`client/src/components/brain/tabs/LinksTab.jsx:599`, `client/src/components/brain/tabs/InboxTab.jsx:387, 512, 606, 765`) share the same shape: `flex items-center gap-2 p-2 bg-port-error/10 border border-port-error/30 rounded` + `<span flex-1>{question}</span>` + Delete + Cancel buttons. They didn't migrate to `<Banner>` because `<Banner>` is shaped around "icon + content + actions" alerts, not "question + confirm/cancel" confirm rows. Build `client/src/components/ui/InlineConfirmRow.jsx` with `{ question, confirmText='Delete', cancelText='Cancel', onConfirm, onCancel, tone='error' }`, then swap the five sites. Pairs naturally with the existing confirmation-UX preference (no two-click-arm).
- [ ] [rich-text-editor-for-prose-stage-replace-plain] **Rich-text editor for prose stage.** Replace the plain textarea in `ProseStage.jsx`. **Decision (resolved 2026-05-30): reuse the existing Writers Room editor** rather than introducing a new markdown-editor dependency — it already exists, keeps the prose-editing experience consistent across surfaces, and avoids a third editor stack. Extract/share the Writers Room editor component for the prose stage.