mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:10:45 +00:00
qa-live: keep telegram failure details with public metadata redaction
This commit is contained in:
@@ -161,6 +161,7 @@ jobs:
|
||||
OPENCLAW_QA_CONVEX_SITE_URL: ${{ secrets.OPENCLAW_QA_CONVEX_SITE_URL }}
|
||||
OPENCLAW_QA_CONVEX_SECRET_CI: ${{ secrets.OPENCLAW_QA_CONVEX_SECRET_CI }}
|
||||
OPENCLAW_QA_REDACT_PUBLIC_METADATA: "1"
|
||||
OPENCLAW_QA_TELEGRAM_CAPTURE_CONTENT: "1"
|
||||
INPUT_SCENARIO: ${{ inputs.scenario }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@@ -436,7 +436,7 @@ describe("telegram live qa runtime", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("redacts observed message metadata in public mode even when content capture is requested", () => {
|
||||
it("keeps observed message content in public mode when capture is requested", () => {
|
||||
const redacted = __testing.buildObservedMessagesArtifact({
|
||||
includeContent: true,
|
||||
redactMetadata: true,
|
||||
@@ -463,12 +463,14 @@ describe("telegram live qa runtime", () => {
|
||||
senderIsBot: true,
|
||||
inlineButtonCount: 1,
|
||||
mediaKinds: ["photo"],
|
||||
text: "secret text",
|
||||
caption: "secret caption",
|
||||
},
|
||||
]);
|
||||
expect(redacted[0]).not.toHaveProperty("timestamp");
|
||||
expect(redacted[0]).not.toHaveProperty("inlineButtons");
|
||||
expect(redacted[0]).not.toHaveProperty("text");
|
||||
expect(redacted[0]).not.toHaveProperty("caption");
|
||||
expect(redacted[0]).not.toHaveProperty("senderId");
|
||||
expect(redacted[0]).not.toHaveProperty("senderUsername");
|
||||
});
|
||||
|
||||
it("keeps raw timestamp and inline button text when metadata redaction is disabled", () => {
|
||||
@@ -566,6 +568,7 @@ describe("telegram live qa runtime", () => {
|
||||
expect(message).toContain("- sutBotId: <redacted>");
|
||||
expect(message).toContain("- sutUsername: <redacted>");
|
||||
expect(message).toContain("- driverMessageId: <redacted>");
|
||||
expect(message).toContain("timed out");
|
||||
expect(message).not.toContain("-100123");
|
||||
expect(message).not.toContain("driver_bot");
|
||||
expect(message).not.toContain("sut_bot");
|
||||
|
||||
@@ -639,7 +639,7 @@ function buildObservedMessagesArtifact(params: {
|
||||
senderUsername: message.senderUsername,
|
||||
replyToMessageId: message.replyToMessageId,
|
||||
};
|
||||
if (!params.includeContent || params.redactMetadata) {
|
||||
if (!params.includeContent) {
|
||||
return base;
|
||||
}
|
||||
return {
|
||||
@@ -803,9 +803,7 @@ function canaryFailureMessage(params: {
|
||||
sutUsername: string;
|
||||
}) {
|
||||
const error = params.error;
|
||||
const details = params.redactMetadata
|
||||
? "details redacted (OPENCLAW_QA_REDACT_PUBLIC_METADATA=1)"
|
||||
: formatErrorMessage(error);
|
||||
const details = formatErrorMessage(error);
|
||||
const phase = isTelegramQaCanaryError(error) ? error.phase : "unknown";
|
||||
const canonicalContext = new Set([
|
||||
"groupId",
|
||||
@@ -906,8 +904,7 @@ export async function runTelegramQaLive(params: {
|
||||
const scenarios = findScenario(params.scenarioIds);
|
||||
const observedMessages: TelegramObservedMessage[] = [];
|
||||
const redactPublicMetadata = isTruthyOptIn(process.env[QA_REDACT_PUBLIC_METADATA_ENV]);
|
||||
const includeObservedMessageContent =
|
||||
!redactPublicMetadata && isTruthyOptIn(process.env[TELEGRAM_QA_CAPTURE_CONTENT_ENV]);
|
||||
const includeObservedMessageContent = isTruthyOptIn(process.env[TELEGRAM_QA_CAPTURE_CONTENT_ENV]);
|
||||
const startedAt = new Date().toISOString();
|
||||
const scenarioResults: TelegramQaScenarioResult[] = [];
|
||||
const cleanupIssues: string[] = [];
|
||||
@@ -1038,9 +1035,7 @@ export async function runTelegramQaLive(params: {
|
||||
id: scenario.id,
|
||||
title: scenario.title,
|
||||
status: "fail",
|
||||
details: redactPublicMetadata
|
||||
? "details redacted (OPENCLAW_QA_REDACT_PUBLIC_METADATA=1)"
|
||||
: formatErrorMessage(error),
|
||||
details: formatErrorMessage(error),
|
||||
});
|
||||
}
|
||||
assertLeaseHealthy();
|
||||
|
||||
Reference in New Issue
Block a user