fix: bound cli dump previews from yaml

This commit is contained in:
Codex
2026-07-01 03:02:16 +00:00
parent a2ed11575d
commit 2210b66eee
7 changed files with 327 additions and 45 deletions
+13 -2
View File
@@ -9,6 +9,7 @@ import {
buildWindowsPowerShellInvocation,
createPosixApplyPatchFileSystem,
createWindowsApplyPatchFileSystem,
createSshStderrForwarder,
createSshStdoutForwarder,
formatSshFailureHint,
formatSshRuntimeTimeoutHint,
@@ -382,6 +383,10 @@ async function runRemoteSshWebSocket(
invocation,
transport: "frontend-websocket",
});
const stderrForwarder = parsed.remoteCommand === null ? null : createSshStderrForwarder({
invocation,
transport: "frontend-websocket",
});
let timedOut = false;
const openTimer = setTimeout(() => {
if (sessionReady || settled) return;
@@ -464,8 +469,14 @@ async function runRemoteSshWebSocket(
}
if (message.type === "ssh.data") {
const chunk = Buffer.from(String(message.data ?? ""), message.encoding === "base64" ? "base64" : "utf8");
if (message.stream === "stderr") process.stderr.write(chunk);
else if (stdoutForwarder === null) {
if (message.stream === "stderr") {
if (stderrForwarder === null) {
process.stderr.write(chunk);
} else {
const hint = stderrForwarder.write(chunk);
if (hint !== null) process.stderr.write(hint);
}
} else if (stdoutForwarder === null) {
process.stdout.write(chunk);
} else {
const hint = stdoutForwarder.write(chunk);