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 stray characters bleeding into shell after watching an agent TUI
[._.]/ Adam Eivya2b916f2bd61
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 4c81e89193..cfbd0331ef 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -108,6 +108,10 @@- **[issue-1615] Series Autopilot now actively notifies you when a run pauses, instead of going silent until you check the status page.** A paused run (budget exhausted, too many High findings, a convergence gate that couldn't auto-resolve, a failed child stage) previously only emitted a live SSE frame — so if you weren't watching the page, the run could sit indefinitely. Every pause now also posts an in-app notification (in the header notification center) with the pause reason and a one-click resume link to the series. A prior pause banner for the same series is cleared first, so a resume→pause cycle leaves exactly one current notification rather than a stack. This is the one autopilot signal that's **on by default** — it's a zero-cost informational banner — but it's overridable per run and via a persisted setting (`pipelineEditorialChecks.notifyOnPause`) and exposed as a "Notify me when a run pauses" checkbox in Options. (`server/services/pipeline/seriesAutopilot.js`, `server/services/notifications.js`, `server/lib/validation.js`, `server/routes/pipeline/autopilot.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)- **[issue-1617] Stopping a Series Autopilot run now gives you immediate feedback instead of looking frozen mid-step.** Cancellation is cooperative — it's honored between steps, so a Stop pressed during a long LLM call was only acted on once that call returned, with no acknowledgement in between. The server now emits a `cancel:acknowledged` SSE frame the instant you press Stop; the button switches to a disabled "Cancelling…" spinner and the live status reads "finishing the active step…" until the run unwinds and the terminal frame lands. The active step still finishes first (no mid-stream interruption) — this is purely the missing acknowledgement, now documented on the cancel route. (`server/services/pipeline/seriesAutopilot.js`, `server/routes/pipeline/autopilot.js`, `client/src/components/pipeline/AutopilotPanel.jsx`)+## Shell++- **Watching an agent TUI no longer leaks stray characters into your next shell.** When a CoS agent TUI (claude/codex) was running and you switched from watching it to your basic/home shell — or opened a fresh one — random escape-sequence characters got typed into the prompt and kept accumulating the longer you sat there (and followed you into a brand-new shell). The Shell page reuses one xterm terminal instance across every session and only called `clear()` on switch, which wipes the screen but leaves the previous session's DEC private modes active. A full-screen TUI turns on mouse-motion and focus tracking, so after switching away those modes stayed on and xterm kept emitting mouse/focus reports as *input* into the now-basic shell. Session switches now do a full `reset()` (modes, parser state, alt-screen, buffers) instead of `clear()`, so a watched TUI's terminal state can't bleed into the next session. (`client/src/pages/Shell.jsx`)+## UI- **Pages no longer body-scroll when their content fits — the app shell is now a fixed-height frame.** The layout root used `min-h-screen`, so when a full-bleed page rendered content that grew to fit (most visibly the Shell page's xterm terminal, whose FitAddon sized to its container and then the `min-h`-driven root grew to *that* — a feedback loop), the whole window scrolled ~166px even though nothing needed to. The root is now `h-screen h-[100dvh]` (with `print:h-auto print:min-h-screen` preserving multi-page print), so `flex-1` children actually bound to the viewport: full-width pages own their internal scroll and normal pages keep scrolling inside `<main>` (`overflow-auto`) — the body never scrolls. (`client/src/components/Layout.jsx`)diff --git a/client/src/pages/Shell.jsx b/client/src/pages/Shell.jsxindex 2a7c75a181..2cee9991bc 100644--- a/client/src/pages/Shell.jsx+++ b/client/src/pages/Shell.jsx@@ -355,7 +355,14 @@ export default function Shell() {setPendingAttach('new');userIdleRef.current = false;if (termInstanceRef.current) {- termInstanceRef.current.clear();+ // reset() not clear(): the xterm instance is reused across every session,+ // and a full-screen TUI (a watched agent-tui claude/codex run) leaves DEC+ // private modes ON — mouse-motion tracking, focus reporting, bracketed+ // paste, alt-screen. clear() only wipes the viewport, so those modes would+ // persist into this fresh shell and make xterm inject escape-sequence+ // reports (mouse/focus events) as INPUT, echoing as accumulating garbage+ // at the prompt. reset() restores the terminal to a clean initial state.+ termInstanceRef.current.reset();termInstanceRef.current.writeln('\x1b[36mStarting shell session...\x1b[0m');}const opts = initialOptsRef.current || {};@@ -372,7 +379,10 @@ export default function Shell() {setPendingAttach(sessionId);userIdleRef.current = false;if (termInstanceRef.current) {- termInstanceRef.current.clear();+ // reset() not clear() — drop any DEC private modes (mouse/focus tracking,+ // alt-screen) the previously-viewed session left active so they can't+ // bleed into this one as injected escape-sequence input. See startSession.+ termInstanceRef.current.reset();termInstanceRef.current.writeln('\x1b[36mAttaching to session...\x1b[0m');}// claim:true → server refuses to displace a different socket. Used by auto-pick@@ -562,7 +572,12 @@ export default function Shell() {cancelPendingAttach();activateSession(sid);if (termInstanceRef.current) {- termInstanceRef.current.clear();+ // reset() not clear(): wipe modes/parser state from the prior session+ // before repainting this one's buffer, so a previously-viewed full-screen+ // TUI's lingering mouse/focus tracking can't inject garbage here. The+ // freshly-painted bufferedOutput re-establishes whatever modes THIS+ // session legitimately uses. See startSession for the full rationale.+ termInstanceRef.current.reset();if (bufferedOutput) {termInstanceRef.current.write(bufferedOutput);}