fix: add provider rootfs diagnostic

This commit is contained in:
Codex
2026-07-05 18:08:17 +00:00
parent 0bb2183a78
commit 42f605dceb
4 changed files with 235 additions and 3 deletions
+32 -1
View File
@@ -102,6 +102,9 @@ interface HostSshSession {
openedAt: number;
tty: boolean;
dataChannelId?: string;
commandBytes: number;
commandDigest: string | null;
cwd: string | null;
}
interface PendingSshDataFrame {
@@ -1983,7 +1986,15 @@ function startHostSshSession(message: CoreHostSshOpenMessage): void {
stdout: "pipe",
stderr: "pipe",
});
hostSshSessions.set(message.sessionId, { proc, openedAt: Date.now(), tty: allocateTty, dataChannelId: message.dataChannelId });
hostSshSessions.set(message.sessionId, {
proc,
openedAt: Date.now(),
tty: allocateTty,
dataChannelId: message.dataChannelId,
commandBytes: command === null ? 0 : Buffer.byteLength(command),
commandDigest,
cwd: message.cwd ?? null,
});
writeSshDataFrame(dataChannel, {
type: "opened",
sessionId: message.sessionId,
@@ -2002,10 +2013,30 @@ function startHostSshSession(message: CoreHostSshOpenMessage): void {
at: new Date().toISOString(),
});
rememberCompletedHostSshSession(message.sessionId, message.dataChannelId, "exit", typeof exitCode === "number" ? exitCode : null);
logger("info", "host_ssh_session_completed", {
sessionId: message.sessionId,
exitCode,
commandBytes: command === null ? 0 : Buffer.byteLength(command),
commandDigest,
tty: allocateTty,
cwd: message.cwd ?? null,
transport: "tcp-pool",
dataChannelId: message.dataChannelId,
});
hostSshSessions.delete(message.sessionId);
releaseSshDataChannel(message.dataChannelId, message.sessionId);
})
.catch((error) => {
logger("error", "host_ssh_session_failed", {
sessionId: message.sessionId,
error: error instanceof Error ? error.message : String(error),
commandBytes: command === null ? 0 : Buffer.byteLength(command),
commandDigest,
tty: allocateTty,
cwd: message.cwd ?? null,
transport: "tcp-pool",
dataChannelId: message.dataChannelId,
});
sendHostSshError(message.sessionId, error);
rememberCompletedHostSshSession(message.sessionId, message.dataChannelId, "error");
hostSshSessions.delete(message.sessionId);