fix ssh tcp pool transient diagnostics

This commit is contained in:
Codex
2026-06-13 17:19:08 +00:00
parent 1ec60de8bb
commit 2cf767b635
7 changed files with 285 additions and 5 deletions
+10 -1
View File
@@ -1,5 +1,5 @@
import { readConfig } from "./src/config";
import { debugDispatch, debugHealth, debugTask, isDebugDispatchCommand, type DebugDispatchCommand } from "./src/debug";
import { debugDispatch, debugHealth, debugSshPool, debugTask, isDebugDispatchCommand, type DebugDispatchCommand } from "./src/debug";
import { isRebuildableService, rebuildService, restartService, stackLogs, stackStatus, startStack, stopStack, unsupportedRebuildService, unsupportedRestartService } from "./src/docker";
import { emitError, emitJson, emitText, isRenderedCliResult } from "./src/output";
import { cancelJob, jobWithTail, listJobs, listJobsSummary, readJob, runJob } from "./src/jobs";
@@ -542,6 +542,15 @@ async function main(): Promise<void> {
emitJson(commandName, await debugHealth(config));
return;
}
if (sub === "ssh-pool") {
const providerId = third ?? "";
if (providerId.length === 0) throw new Error("debug ssh-pool requires providerId");
const result = await debugSshPool(config, providerId);
const ok = (result as { ok?: unknown }).ok !== false;
emitJson(commandName, result, ok);
if (!ok) process.exitCode = 1;
return;
}
if (sub === "dispatch") {
const providerId = isDebugDispatchCommand(third) ? config.providerGateway.id : third ?? config.providerGateway.id;
const commandArg = isDebugDispatchCommand(third) ? third : fourth;