mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-04 22:49:41 +02:00
fix(sessions): route antigravity launches through the ownership helpers
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>
This commit is contained in:
@@ -1120,9 +1120,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
const _runLoc = (this.cases || []).find(c => c.name === caseName)?.location;
|
||||
const isRemote = _runLoc === 'remote' || _runLoc === 'docker';
|
||||
|
||||
this.terminal.clear();
|
||||
this.terminal.writeln(`\x1b[1;32m Starting Antigravity session in ${caseName}...\x1b[0m`);
|
||||
this.terminal.writeln('');
|
||||
const ownsLaunchTerminal = this._beginSessionLaunchStatus(`Starting Antigravity session in ${caseName}...`);
|
||||
this.terminal.focus();
|
||||
|
||||
try {
|
||||
@@ -1130,8 +1128,10 @@ Object.assign(CodemanApp.prototype, {
|
||||
const statusRes = await fetch('/api/antigravity/status');
|
||||
const status = (await statusRes.json()).data;
|
||||
if (!status.available) {
|
||||
this.terminal.writeln('\x1b[1;31m Antigravity CLI not found.\x1b[0m');
|
||||
this.terminal.writeln('\x1b[90m Install with: curl -fsSL https://antigravity.google/cli/install.sh | bash\x1b[0m');
|
||||
this._reportSessionLaunchError(
|
||||
ownsLaunchTerminal,
|
||||
'Antigravity CLI not found. Install with: curl -fsSL https://antigravity.google/cli/install.sh | bash'
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1160,7 +1160,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
|
||||
this.terminal.focus();
|
||||
} catch (err) {
|
||||
this.terminal.writeln(`\x1b[1;31m Error: ${err.message}\x1b[0m`);
|
||||
this._reportSessionLaunchError(ownsLaunchTerminal, err.message);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user