mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor: consolidate coercion contracts (#122458)
* refactor: consolidate coercion contracts Centralize exact string, record, numeric, date, Boolean, argument, and structured-error coercions while preserving call-site semantics. Migrate canonical-name collisions and deprecated internal SDK bypasses, deleting 55 net production/tooling lines. Expand declaration ownership enforcement to 101 allowed helpers and add a narrow export-completeness audit. * fix: preserve standalone script coercions Keep copied Control UI tooling self-contained and retain the trusted release harness module-relative source seam when the harness runs against an old target cwd.
This commit is contained in:
committed by
GitHub
parent
66fe424590
commit
b080dd1e76
@@ -11,7 +11,7 @@ function parseExpectedStatus(raw) {
|
||||
return Number(raw);
|
||||
}
|
||||
|
||||
function resolveTimerTimeoutMs(valueMs, fallbackMs) {
|
||||
function resolveOpenWebUiHttpProbeTimeoutMs(valueMs, fallbackMs) {
|
||||
const value = Number.isFinite(valueMs) ? valueMs : fallbackMs;
|
||||
return Math.min(Math.max(Math.floor(value), 1), MAX_TIMER_TIMEOUT_MS);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export async function probeHttpStatus({
|
||||
throw new Error("usage: http-probe.mjs <url> [status|lt500]");
|
||||
}
|
||||
const expectedStatus = expectedRaw === "lt500" ? undefined : parseExpectedStatus(expectedRaw);
|
||||
const resolvedTimeoutMs = resolveTimerTimeoutMs(timeoutMs, 30_000);
|
||||
const resolvedTimeoutMs = resolveOpenWebUiHttpProbeTimeoutMs(timeoutMs, 30_000);
|
||||
const controller = new AbortController();
|
||||
const timer = setTimeout(() => controller.abort(), resolvedTimeoutMs);
|
||||
let res;
|
||||
|
||||
Reference in New Issue
Block a user