Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

test(pty): wait for terminal output to drain after exit

Rahman601804e50441
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 58e2380a..802f1086 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -19,6 +19,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Tests**
+- `pty` wait for terminal output to drain after exit
- remove obsolete preview directory configuration
- validate the bundle fixture before checking tag rejection
- stabilize authenticated release journeys and retain build failure logs
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index ebf2a5c3..50efcdf8 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -2,6 +2,8 @@
Deployment log inspection caught sixteen additional Turbopack warnings. Instrumentation now places Node-only imports inside explicit positive runtime branches, following the Next instrumentation contract (https://nextjs.org/docs/app/guides/instrumentation). Host state, credentials, external Git metadata and installed executables are explicitly runtime-only filesystem inputs rather than traced application assets; existing authorization, containment, size and symlink checks remain intact. The release build now rejects warning output instead of discarding it on successful compilation. MCP setup leads with numbered actions and puts optional display metadata below them; copy text wraps at word boundaries on narrow screens.
+A required PTY test exposed an exit/data ordering race under full-suite load. Its harness now waits for both successful process exit and the final quit payload, preserving the real-terminal assertion instead of resolving a partially drained transcript. Semgrep 1.174.0 and the latest 1.176.0 both report zero findings but forty parser diagnostics on valid Bash/TypeScript/JSX; this remains a scanner coverage limitation, not evidence of complete SAST coverage. No scanner excludes or suppressions were added.
+
## 2026-09-09 — Zero-warning quality gate and layered MCP settings
User review found MCP confusing despite the earlier release. Live public inspection reproduced an endless MCP loading placeholder after unauthorized access. Owner setup mixed client guides, transport details, access tokens, catalog signatures and audit activity in one scroll. MCP now starts with a task index and drills into client selection then one guide. Connection details, connected-app management, audit and tools each have a separate view and explicit return path. Signed-out users get a direct Owner login preserving the MCP destination; delegated users retain the Owner boundary. Requests are bounded and failed activity never masquerades as no events. Disconnection requires an inline confirmation; active access and expired/revoked history are separated. Refresh acknowledgement explicitly remains a browser-local reminder. Settings icons use theme tokens; navigation and copy targets are larger and clipboard failures are visible. Manual OAuth copy now matches the implemented one-hour access / rotating refresh contract.
diff --git a/scripts/mso-integrations-finder-pty.test.ts b/scripts/mso-integrations-finder-pty.test.ts
index b7116268..0de2ebcf 100644
--- a/scripts/mso-integrations-finder-pty.test.ts
+++ b/scripts/mso-integrations-finder-pty.test.ts
@@ -26,13 +26,22 @@ function run(cols: number, rows: number) {
const child = pty.spawn(process.execPath, [path.join(__dirname, "mso-integrations-finder.mjs"), config], {
cols, rows, cwd: __dirname, env: { ...process.env, NO_COLOR: "1" }, name: "xterm-256color",
});
- let output = "", sent = false;
+ let output = "", sent = false, exited = false;
+ const complete = () => {
+ if (exited && output.includes('"type":"quit"')) { clearTimeout(timer); resolve(output); }
+ };
const timer = setTimeout(() => { try { child.kill(); } catch {} reject(new Error(`PTY ${cols}x${rows} timed out`)); }, 3000);
child.onData((data) => {
output += data;
if (!sent && output.includes("INSPECTOR")) { sent = true; child.write("\x04"); }
+ complete();
+ });
+ // PTY exit can arrive before the final data callback; require both proofs.
+ child.onExit(({ exitCode }) => {
+ exited = true;
+ if (exitCode !== 0) { clearTimeout(timer); reject(new Error(`PTY exited with ${exitCode}`)); }
+ else complete();
});
- child.onExit(() => { clearTimeout(timer); resolve(output); });
});
}