mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 16:10:43 +00:00
* fix(agents): stop treating session lock waits as timeout * fix(agents): ignore abort-wrapped session lock waits * fix(agents): keep explicit failover metadata authoritative * fix(agents): respect inferred failover metadata * fix(agents): ignore generic abort codes for lock waits * fix(agents): suppress cause-based lock wait fallback * fix(agents): type session lock timeout errors * fix: stop session lock failover (#68700) (thanks @MonkeyLeeT) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
30 lines
921 B
TypeScript
30 lines
921 B
TypeScript
export const SESSION_WRITE_LOCK_TIMEOUT_CODE = "OPENCLAW_SESSION_WRITE_LOCK_TIMEOUT";
|
|
|
|
export class SessionWriteLockTimeoutError extends Error {
|
|
readonly code = SESSION_WRITE_LOCK_TIMEOUT_CODE;
|
|
readonly timeoutMs: number;
|
|
readonly owner: string;
|
|
readonly lockPath: string;
|
|
|
|
constructor(params: { timeoutMs: number; owner: string; lockPath: string }) {
|
|
super(
|
|
`session file locked (timeout ${params.timeoutMs}ms): ${params.owner} ${params.lockPath}`,
|
|
);
|
|
this.name = "SessionWriteLockTimeoutError";
|
|
this.timeoutMs = params.timeoutMs;
|
|
this.owner = params.owner;
|
|
this.lockPath = params.lockPath;
|
|
}
|
|
}
|
|
|
|
export function isSessionWriteLockTimeoutError(err: unknown): boolean {
|
|
return (
|
|
err instanceof SessionWriteLockTimeoutError ||
|
|
Boolean(
|
|
err &&
|
|
typeof err === "object" &&
|
|
(err as { code?: unknown }).code === SESSION_WRITE_LOCK_TIMEOUT_CODE,
|
|
)
|
|
);
|
|
}
|