mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 22:14:47 +00:00
fix(browser): preserve raw chrome launch diagnostics
This commit is contained in:
@@ -517,6 +517,16 @@ describe("chrome.ts internal", () => {
|
||||
});
|
||||
|
||||
it("clears stale singleton locks and retries once after profile-in-use launch failure", async () => {
|
||||
const configPath = path.join(tmpDir, "openclaw.json");
|
||||
await fsp.writeFile(
|
||||
configPath,
|
||||
JSON.stringify({
|
||||
logging: {
|
||||
redactPatterns: ["profile appears to be in use by another Chromium process"],
|
||||
},
|
||||
}),
|
||||
);
|
||||
vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath);
|
||||
let cdpReachable = false;
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
|
||||
@@ -542,9 +542,9 @@ export async function launchOpenClawChrome(
|
||||
const diagnosticText = await diagnoseChromeCdp(profile.cdpUrl)
|
||||
.then(formatChromeCdpDiagnostic)
|
||||
.catch((err) => `CDP diagnostic failed: ${safeChromeCdpErrorMessage(err)}.`);
|
||||
const stderrOutput = redactSensitiveText(
|
||||
normalizeOptionalString(Buffer.concat(stderrChunks).toString("utf8")) ?? "",
|
||||
);
|
||||
const stderrOutput =
|
||||
normalizeOptionalString(Buffer.concat(stderrChunks).toString("utf8")) ?? "";
|
||||
const redactedStderrOutput = redactSensitiveText(stderrOutput);
|
||||
if (
|
||||
allowSingletonRecovery &&
|
||||
CHROME_SINGLETON_IN_USE_PATTERN.test(stderrOutput) &&
|
||||
@@ -556,8 +556,8 @@ export async function launchOpenClawChrome(
|
||||
await terminateChromeForRetry(proc, userDataDir);
|
||||
return await launchOnceAndWait(false);
|
||||
}
|
||||
const stderrHint = stderrOutput
|
||||
? `\nChrome stderr:\n${stderrOutput.slice(0, CHROME_STDERR_HINT_MAX_CHARS)}`
|
||||
const stderrHint = redactedStderrOutput
|
||||
? `\nChrome stderr:\n${redactedStderrOutput.slice(0, CHROME_STDERR_HINT_MAX_CHARS)}`
|
||||
: "";
|
||||
const launchHints = chromeLaunchHints({ stderrOutput, resolved, profile, launchOptions });
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user