Download src/infra/agent-lifecycle-error.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/infra/agent-lifecycle-error.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/infra/agent-lifecycle-error.ts
-
curl -L -o agent-lifecycle-error.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/infra/agent-lifecycle-error.ts
669 Bytes
| const AGENT_RUN_STALE_LIFECYCLE_ERROR = "Agent run belongs to a stale gateway lifecycle"; | |
| const AGENT_RUN_STALE_LIFECYCLE_ERROR_CODE = "ERR_STALE_GATEWAY_LIFECYCLE"; | |
| export function createAgentRunStaleLifecycleError(): Error { | |
| const error = new Error(AGENT_RUN_STALE_LIFECYCLE_ERROR) as Error & { code: string }; | |
| error.name = "AbortError"; | |
| error.code = AGENT_RUN_STALE_LIFECYCLE_ERROR_CODE; | |
| return error; | |
| } | |
| export function isAgentRunStaleLifecycleError(value: unknown): boolean { | |
| try { | |
| return ( | |
| value instanceof Error && | |
| "code" in value && | |
| value.code === AGENT_RUN_STALE_LIFECYCLE_ERROR_CODE | |
| ); | |
| } catch { | |
| return false; | |
| } | |
| } | |