fix(browser): preserve raw chrome launch diagnostics · openclaw/openclaw@55e4b76
vincentkoc
·
2026-05-17
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -517,6 +517,16 @@ describe("chrome.ts internal", () => {
|
517 | 517 | }); |
518 | 518 | |
519 | 519 | it("clears stale singleton locks and retries once after profile-in-use launch failure", async () => { |
| 520 | +const configPath = path.join(tmpDir, "openclaw.json"); |
| 521 | +await fsp.writeFile( |
| 522 | +configPath, |
| 523 | +JSON.stringify({ |
| 524 | +logging: { |
| 525 | +redactPatterns: ["profile appears to be in use by another Chromium process"], |
| 526 | +}, |
| 527 | +}), |
| 528 | +); |
| 529 | +vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath); |
520 | 530 | let cdpReachable = false; |
521 | 531 | vi.stubGlobal( |
522 | 532 | "fetch", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -542,9 +542,9 @@ export async function launchOpenClawChrome(
|
542 | 542 | const diagnosticText = await diagnoseChromeCdp(profile.cdpUrl) |
543 | 543 | .then(formatChromeCdpDiagnostic) |
544 | 544 | .catch((err) => `CDP diagnostic failed: ${safeChromeCdpErrorMessage(err)}.`); |
545 | | -const stderrOutput = redactSensitiveText( |
546 | | -normalizeOptionalString(Buffer.concat(stderrChunks).toString("utf8")) ?? "", |
547 | | -); |
| 545 | +const stderrOutput = |
| 546 | +normalizeOptionalString(Buffer.concat(stderrChunks).toString("utf8")) ?? ""; |
| 547 | +const redactedStderrOutput = redactSensitiveText(stderrOutput); |
548 | 548 | if ( |
549 | 549 | allowSingletonRecovery && |
550 | 550 | CHROME_SINGLETON_IN_USE_PATTERN.test(stderrOutput) && |
@@ -556,8 +556,8 @@ export async function launchOpenClawChrome(
|
556 | 556 | await terminateChromeForRetry(proc, userDataDir); |
557 | 557 | return await launchOnceAndWait(false); |
558 | 558 | } |
559 | | -const stderrHint = stderrOutput |
560 | | - ? `\nChrome stderr:\n${stderrOutput.slice(0, CHROME_STDERR_HINT_MAX_CHARS)}` |
| 559 | +const stderrHint = redactedStderrOutput |
| 560 | + ? `\nChrome stderr:\n${redactedStderrOutput.slice(0, CHROME_STDERR_HINT_MAX_CHARS)}` |
561 | 561 | : ""; |
562 | 562 | const launchHints = chromeLaunchHints({ stderrOutput, resolved, profile, launchOptions }); |
563 | 563 | try { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。