Skip to content

Commit 259eda6

Browse files
committed
fix: document agent cleanup catch intent
1 parent b01e612 commit 259eda6

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/agents/minimax-vlm.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ function coerceApiHost(params: {
5454
try {
5555
const url = new URL(raw);
5656
return url.origin;
57-
} catch {}
57+
} catch {
58+
// Bare hosts are retried with https:// below; malformed absolute URLs fall
59+
// back to provider defaults instead of sending requests to invalid endpoints.
60+
}
5861

5962
if (/^[a-z][a-z\d+.-]*:\/\//i.test(raw)) {
6063
return defaultHost;

src/agents/provider-http-errors.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ export async function readResponseTextLimited(
8181
}
8282
try {
8383
reader.releaseLock();
84-
} catch {}
84+
} catch {
85+
// Error-body reads are diagnostic best effort; release failures must not
86+
// hide the bounded provider error text already captured.
87+
}
8588
}
8689

8790
return text;

src/agents/runtime/proxy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,10 @@ export function streamProxy(
409409
} finally {
410410
try {
411411
reader?.releaseLock();
412-
} catch {}
412+
} catch {
413+
// Stream handling above already pushed the terminal proxy event;
414+
// cleanup failures must not replace it with a secondary release error.
415+
}
413416
if (options.signal) {
414417
options.signal.removeEventListener("abort", abortHandler);
415418
}

src/agents/tools/web-shared.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ export async function readResponseText(
287287
}
288288
try {
289289
reader.releaseLock();
290-
} catch {}
290+
} catch {
291+
// The read/cancel path already produced the best-effort body result;
292+
// lock-release failures must not replace that outcome.
293+
}
291294
}
292295

293296
const bytes = concatBytes(parts, bytesRead);

0 commit comments

Comments
 (0)