mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix: document stream cleanup fallback intent
This commit is contained in:
@@ -54,7 +54,10 @@ function coerceApiHost(params: {
|
||||
try {
|
||||
const url = new URL(raw);
|
||||
return url.origin;
|
||||
} catch {}
|
||||
} catch {
|
||||
// Bare hosts are retried with https:// below; malformed absolute URLs fall
|
||||
// back to provider defaults instead of sending requests to invalid endpoints.
|
||||
}
|
||||
|
||||
if (/^[a-z][a-z\d+.-]*:\/\//i.test(raw)) {
|
||||
return defaultHost;
|
||||
|
||||
@@ -81,7 +81,10 @@ export async function readResponseTextLimited(
|
||||
}
|
||||
try {
|
||||
reader.releaseLock();
|
||||
} catch {}
|
||||
} catch {
|
||||
// Error-body reads are diagnostic best effort; release failures must not
|
||||
// hide the bounded provider error text already captured.
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
|
||||
@@ -409,7 +409,10 @@ export function streamProxy(
|
||||
} finally {
|
||||
try {
|
||||
reader?.releaseLock();
|
||||
} catch {}
|
||||
} catch {
|
||||
// Stream handling above already pushed the terminal proxy event;
|
||||
// cleanup failures must not replace it with a secondary release error.
|
||||
}
|
||||
if (options.signal) {
|
||||
options.signal.removeEventListener("abort", abortHandler);
|
||||
}
|
||||
|
||||
@@ -287,7 +287,10 @@ export async function readResponseText(
|
||||
}
|
||||
try {
|
||||
reader.releaseLock();
|
||||
} catch {}
|
||||
} catch {
|
||||
// The read/cancel path already produced the best-effort body result;
|
||||
// lock-release failures must not replace that outcome.
|
||||
}
|
||||
}
|
||||
|
||||
const bytes = concatBytes(parts, bytesRead);
|
||||
|
||||
Reference in New Issue
Block a user