refactor(qa): reuse live transport option helper · openclaw/openclaw@0a1ce14
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
File tree
extensions/qa-lab/src/live-transports
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ import { chromium } from "playwright-core";
|
17 | 17 | import { z } from "zod"; |
18 | 18 | import { QA_EVIDENCE_FILENAME, buildLiveTransportEvidenceSummary } from "../../evidence-summary.js"; |
19 | 19 | import { startQaGatewayChild } from "../../gateway-child.js"; |
| 20 | +import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
20 | 21 | import { DEFAULT_QA_LIVE_PROVIDER_MODE } from "../../providers/index.js"; |
21 | 22 | import { |
22 | 23 | defaultQaModelForMode, |
@@ -382,11 +383,6 @@ function resolveEnvValue(env: NodeJS.ProcessEnv, key: (typeof DISCORD_QA_ENV_KEY
|
382 | 383 | return value; |
383 | 384 | } |
384 | 385 | |
385 | | -function isTruthyOptIn(value: string | undefined) { |
386 | | -const normalized = value?.trim().toLowerCase(); |
387 | | -return normalized === "1" || normalized === "true" || normalized === "yes"; |
388 | | -} |
389 | | - |
390 | 386 | function resolveDiscordQaRuntimeEnv(env: NodeJS.ProcessEnv = process.env): DiscordQaRuntimeEnv { |
391 | 387 | const voiceChannelId = env.OPENCLAW_QA_DISCORD_VOICE_CHANNEL_ID?.trim(); |
392 | 388 | const runtimeEnv = { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,6 +11,7 @@ import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
11 | 11 | import { z } from "zod"; |
12 | 12 | import { QA_EVIDENCE_FILENAME, buildLiveTransportEvidenceSummary } from "../../evidence-summary.js"; |
13 | 13 | import { startQaGatewayChild } from "../../gateway-child.js"; |
| 14 | +import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
14 | 15 | import { DEFAULT_QA_LIVE_PROVIDER_MODE } from "../../providers/index.js"; |
15 | 16 | import { |
16 | 17 | defaultQaModelForMode, |
@@ -504,11 +505,6 @@ function resolveEnvValue(env: NodeJS.ProcessEnv, key: (typeof SLACK_QA_ENV_KEYS)
|
504 | 505 | return value; |
505 | 506 | } |
506 | 507 | |
507 | | -function isTruthyOptIn(value: string | undefined) { |
508 | | -const normalized = value?.trim().toLowerCase(); |
509 | | -return normalized === "1" || normalized === "true" || normalized === "yes"; |
510 | | -} |
511 | | - |
512 | 508 | function inferSlackCredentialSource( |
513 | 509 | value: string | undefined, |
514 | 510 | env: NodeJS.ProcessEnv = process.env, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ import {
|
17 | 17 | type QaEvidenceTiming, |
18 | 18 | } from "../../evidence-summary.js"; |
19 | 19 | import { startQaGatewayChild } from "../../gateway-child.js"; |
| 20 | +import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
20 | 21 | import { DEFAULT_QA_LIVE_PROVIDER_MODE } from "../../providers/index.js"; |
21 | 22 | import { |
22 | 23 | defaultQaModelForMode, |
@@ -565,11 +566,6 @@ function resolveEnvValue(env: NodeJS.ProcessEnv, key: (typeof TELEGRAM_QA_ENV_KE
|
565 | 566 | return value; |
566 | 567 | } |
567 | 568 | |
568 | | -function isTruthyOptIn(value: string | undefined) { |
569 | | -const normalized = value?.trim().toLowerCase(); |
570 | | -return normalized === "1" || normalized === "true" || normalized === "yes"; |
571 | | -} |
572 | | - |
573 | 569 | function readConfigRecord(root: Record<string, unknown>, key: string): Record<string, unknown> { |
574 | 570 | const value = root[key]; |
575 | 571 | if (!isRecord(value)) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
|
17 | 17 | import { z } from "zod"; |
18 | 18 | import { QA_EVIDENCE_FILENAME, buildLiveTransportEvidenceSummary } from "../../evidence-summary.js"; |
19 | 19 | import { startQaGatewayChild } from "../../gateway-child.js"; |
| 20 | +import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
20 | 21 | import { DEFAULT_QA_LIVE_PROVIDER_MODE } from "../../providers/index.js"; |
21 | 22 | import { fingerprintQaCredentialId } from "../../qa-credentials-fingerprint.runtime.js"; |
22 | 23 | import { |
@@ -1387,11 +1388,6 @@ export const WHATSAPP_QA_STANDARD_SCENARIO_IDS = collectLiveTransportStandardSce
|
1387 | 1388 | scenarios: WHATSAPP_QA_SCENARIOS, |
1388 | 1389 | }); |
1389 | 1390 | |
1390 | | -function isTruthyOptIn(value: string | undefined) { |
1391 | | -const normalized = value?.trim().toLowerCase(); |
1392 | | -return normalized === "1" || normalized === "true" || normalized === "yes"; |
1393 | | -} |
1394 | | - |
1395 | 1391 | function resolveEnvValue(env: NodeJS.ProcessEnv, key: (typeof WHATSAPP_QA_ENV_KEYS)[number]) { |
1396 | 1392 | const value = env[key]?.trim(); |
1397 | 1393 | if (!value) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。