mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 01:31:23 +00:00
Update contributing, deduplicate more functions
This commit is contained in:
@@ -1 +1,17 @@
|
||||
export { isAbortError } from "../../infra/unhandled-rejections.js";
|
||||
/**
|
||||
* Runner abort check. Catches any abort-related message for embedded runners.
|
||||
* More permissive than the core isAbortError since runners need to catch
|
||||
* various abort signals from different sources.
|
||||
*/
|
||||
export function isRunnerAbortError(err: unknown): boolean {
|
||||
if (!err || typeof err !== "object") {
|
||||
return false;
|
||||
}
|
||||
const name = "name" in err ? String(err.name) : "";
|
||||
if (name === "AbortError") {
|
||||
return true;
|
||||
}
|
||||
const message =
|
||||
"message" in err && typeof err.message === "string" ? err.message.toLowerCase() : "";
|
||||
return message.includes("aborted");
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ import { buildSystemPromptParams } from "../../system-prompt-params.js";
|
||||
import { buildSystemPromptReport } from "../../system-prompt-report.js";
|
||||
import { resolveTranscriptPolicy } from "../../transcript-policy.js";
|
||||
import { DEFAULT_BOOTSTRAP_FILENAME } from "../../workspace.js";
|
||||
import { isAbortError } from "../abort.js";
|
||||
import { isRunnerAbortError } from "../abort.js";
|
||||
import { appendCacheTtlTimestamp, isCacheTtlEligibleProvider } from "../cache-ttl.js";
|
||||
import { buildEmbeddedExtensionPaths } from "../extensions.js";
|
||||
import { applyExtraParamsToAgent } from "../extra-params.js";
|
||||
@@ -832,7 +832,7 @@ export async function runEmbeddedAttempt(
|
||||
try {
|
||||
await waitForCompactionRetry();
|
||||
} catch (err) {
|
||||
if (isAbortError(err)) {
|
||||
if (isRunnerAbortError(err)) {
|
||||
if (!promptError) {
|
||||
promptError = err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user