





























@@ -118,6 +118,7 @@ export type TelegramQaRunResult = {
118118reportPath: string;
119119summaryPath: string;
120120observedMessagesPath: string;
121+gatewayDebugDirPath?: string;
121122scenarios: TelegramQaScenarioResult[];
122123};
123124@@ -664,6 +665,7 @@ function renderTelegramQaMarkdown(params: {
664665credentialSource: "convex" | "env";
665666redactMetadata: boolean;
666667groupId: string;
668+gatewayDebugDirPath?: string;
667669startedAt: string;
668670finishedAt: string;
669671scenarios: TelegramQaScenarioResult[];
@@ -690,6 +692,12 @@ function renderTelegramQaMarkdown(params: {
690692}
691693lines.push("");
692694}
695+if (params.gatewayDebugDirPath) {
696+lines.push("## Gateway Debug");
697+lines.push("");
698+lines.push(`- Preserved at: \`${params.gatewayDebugDirPath}\``);
699+lines.push("");
700+}
693701if (params.cleanupIssues.length > 0) {
694702lines.push("## Cleanup");
695703lines.push("");
@@ -1094,6 +1102,8 @@ export async function runTelegramQaLive(params: {
10941102const startedAt = new Date().toISOString();
10951103const scenarioResults: TelegramQaScenarioResult[] = [];
10961104const cleanupIssues: string[] = [];
1105+const gatewayDebugDirPath = path.join(outputDir, "gateway-debug");
1106+let preservedGatewayDebugArtifacts = false;
10971107let canaryFailure: string | null = null;
10981108try {
10991109if (params.sutOpenClawCommand && params.preflightInstalledOnboarding === true) {
@@ -1296,7 +1306,13 @@ export async function runTelegramQaLive(params: {
12961306}
12971307} finally {
12981308try {
1299-await gatewayHarness.stop();
1309+const shouldPreserveGatewayDebugArtifacts = scenarioResults.some(
1310+(scenario) => scenario.status === "fail",
1311+);
1312+await gatewayHarness.stop(
1313+shouldPreserveGatewayDebugArtifacts ? { preserveToDir: gatewayDebugDirPath } : undefined,
1314+);
1315+preservedGatewayDebugArtifacts = shouldPreserveGatewayDebugArtifacts;
13001316} catch (error) {
13011317appendLiveLaneIssue(cleanupIssues, "live gateway cleanup", error);
13021318}
@@ -1352,6 +1368,7 @@ export async function runTelegramQaLive(params: {
13521368 credentialSource: credentialLease.source,
13531369 redactMetadata: redactPublicMetadata,
13541370 groupId: redactPublicMetadata ? "<redacted>" : runtimeEnv.groupId,
1371+ gatewayDebugDirPath: preservedGatewayDebugArtifacts ? gatewayDebugDirPath : undefined,
13551372 startedAt,
13561373 finishedAt,
13571374 scenarios: scenarioResults,
@@ -1379,6 +1396,7 @@ export async function runTelegramQaLive(params: {
13791396report: reportPath,
13801397summary: summaryPath,
13811398observedMessages: observedMessagesPath,
1399+ ...(preservedGatewayDebugArtifacts ? { gatewayDebug: gatewayDebugDirPath } : {}),
13821400};
13831401if (canaryFailure) {
13841402throw new Error(
@@ -1403,6 +1421,7 @@ export async function runTelegramQaLive(params: {
14031421 reportPath,
14041422 summaryPath,
14051423 observedMessagesPath,
1424+ ...(preservedGatewayDebugArtifacts ? { gatewayDebugDirPath } : {}),
14061425scenarios: scenarioResults,
14071426};
14081427}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。