feat(version): upgrade openclaw version 4.11 (#845)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import type { GatewayStatus } from '@/types/gateway';
|
||||
|
||||
export const CHAT_HISTORY_RPC_TIMEOUT_MS = 35_000;
|
||||
export const CHAT_HISTORY_STARTUP_RETRY_DELAYS_MS = [600] as const;
|
||||
export const CHAT_HISTORY_STARTUP_CONNECTION_GRACE_MS = 15_000;
|
||||
export const CHAT_HISTORY_STARTUP_RETRY_DELAYS_MS = [800, 2_000, 4_000, 8_000] as const;
|
||||
export const CHAT_HISTORY_STARTUP_CONNECTION_GRACE_MS = 30_000;
|
||||
export const CHAT_HISTORY_STARTUP_RUNNING_WINDOW_MS =
|
||||
CHAT_HISTORY_RPC_TIMEOUT_MS + CHAT_HISTORY_STARTUP_CONNECTION_GRACE_MS;
|
||||
export const CHAT_HISTORY_DEFAULT_LOADING_SAFETY_TIMEOUT_MS = 15_000;
|
||||
@@ -11,11 +11,20 @@ export const CHAT_HISTORY_LOADING_SAFETY_TIMEOUT_MS =
|
||||
+ CHAT_HISTORY_STARTUP_RETRY_DELAYS_MS.reduce((sum, delay) => sum + delay, 0)
|
||||
+ 2_000;
|
||||
|
||||
export type HistoryRetryErrorKind = 'timeout' | 'gateway_unavailable';
|
||||
export type HistoryRetryErrorKind = 'timeout' | 'gateway_unavailable' | 'gateway_startup';
|
||||
|
||||
export function classifyHistoryStartupRetryError(error: unknown): HistoryRetryErrorKind | null {
|
||||
const message = String(error).toLowerCase();
|
||||
|
||||
if (
|
||||
message.includes('unavailable during gateway startup')
|
||||
|| message.includes('unavailable during startup')
|
||||
|| message.includes('not yet ready')
|
||||
|| message.includes('service not initialized')
|
||||
) {
|
||||
return 'gateway_startup';
|
||||
}
|
||||
|
||||
if (
|
||||
message.includes('rpc timeout: chat.history')
|
||||
|| message.includes('gateway rpc timeout: chat.history')
|
||||
@@ -47,6 +56,11 @@ export function shouldRetryStartupHistoryLoad(
|
||||
): boolean {
|
||||
if (!gatewayStatus || !errorKind) return false;
|
||||
|
||||
// The gateway explicitly told us it's still initializing -- always retry
|
||||
if (errorKind === 'gateway_startup') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (gatewayStatus.state === 'starting') {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user