Skip to content

fix(sessions): preserve active terminal during launches - #180

Merged
Ark0N merged 3 commits into
Ark0N:masterfrom
Lint111:agent/split-preserve-active-launch
Aug 4, 2026
Merged

fix(sessions): preserve active terminal during launches#180
Ark0N merged 3 commits into
Ark0N:masterfrom
Lint111:agent/split-preserve-active-launch

Conversation

@Lint111

Copy link
Copy Markdown
Contributor

Summary

  • Route session-launch progress through small ownership-aware helpers.
  • Keep terminal progress output on the session-less home screen.
  • Use informational/error toasts when another session already owns the shared xterm.
  • Apply the same behavior to Claude, shell, OpenCode, Codex, and Gemini launches.

Root cause

Starting a new session always cleared and wrote launch status into the shared terminal. If another session was active, the later session switch could serialize that launch chrome into the active session's cached terminal frame, producing a mixed or stale view.

Scope

This is the active-session launch-preservation slice extracted from #173. It changes only frontend launch-status routing and its focused regression test. Session creation APIs and launch sequencing are unchanged.

Behavior

  • No active session: launch progress continues to render in xterm.
  • Active session: xterm is left untouched and launch status uses toasts.
  • A session becoming active during launch prevents later progress lines from writing into it.

Validation

  • npx vitest run --config config/vitest.config.ts test/run-mode-ui.test.ts: 14 passed
  • npm run check:frontend-syntax: 26 files passed
  • npm run build: passed
  • Commit formatting hook: passed
  • git diff --check: passed

@Lint111
Lint111 marked this pull request as ready for review July 29, 2026 17:24
CopilotAI review requested due to automatic review settings July 29, 2026 17:24

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

runAntigravity() landed on master after this branch was cut, so it kept the
exact pattern the rest of this PR removes: terminal.clear() plus direct
writeln into whatever session happened to be active. Merging master in
surfaced it, leaving one of six run modes still wiping the active session's
xterm on launch.
Also adds regression coverage that can actually see the bug. The existing
test drives the three helpers directly, so it stays green even when a run*()
function is reverted to writing at the terminal itself: reverting
runClaude()'s call site keeps all 16 tests passing. The new static guard
scans session-ui.js and fails if any run*() body touches
this.terminal.clear/writeln, which catches a regressed call site and would
have caught runAntigravity on its own. A second unit test covers the
home-screen path that nothing exercised: with no active session, launch
progress must still clear and render in the terminal.
Verified in a browser against a live instance. With a session active,
runShell() and runAntigravity() leave its terminal untouched (clear() calls:
0, writes: 0) and emit one info toast; on master the same run wipes the
session's marker text. The session-less home screen still clears and writes
exactly as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Ark0N
Ark0N merged commit db24fc6 into Ark0N:masterAug 4, 2026
2 checks passed
@Ark0N

Ark0N commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Thank you for this contribution!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Lint111@Ark0N@claude