mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 20:20:22 +00:00
refactor: move channel backoff helpers onto runtime-env
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
|||||||
resolveDefaultGroupPolicy,
|
resolveDefaultGroupPolicy,
|
||||||
warnMissingProviderGroupPolicyFallbackOnce,
|
warnMissingProviderGroupPolicyFallbackOnce,
|
||||||
} from "openclaw/plugin-sdk/config-runtime";
|
} from "openclaw/plugin-sdk/config-runtime";
|
||||||
import type { BackoffPolicy } from "openclaw/plugin-sdk/infra-runtime";
|
|
||||||
import { waitForTransportReady } from "openclaw/plugin-sdk/infra-runtime";
|
import { waitForTransportReady } from "openclaw/plugin-sdk/infra-runtime";
|
||||||
import { saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
|
import { saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
|
||||||
import { DEFAULT_GROUP_HISTORY_LIMIT, type HistoryEntry } from "openclaw/plugin-sdk/reply-history";
|
import { DEFAULT_GROUP_HISTORY_LIMIT, type HistoryEntry } from "openclaw/plugin-sdk/reply-history";
|
||||||
@@ -20,7 +19,11 @@ import {
|
|||||||
resolveChunkMode,
|
resolveChunkMode,
|
||||||
resolveTextChunkLimit,
|
resolveTextChunkLimit,
|
||||||
} from "openclaw/plugin-sdk/reply-runtime";
|
} from "openclaw/plugin-sdk/reply-runtime";
|
||||||
import { createNonExitingRuntime, type RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
import {
|
||||||
|
createNonExitingRuntime,
|
||||||
|
type BackoffPolicy,
|
||||||
|
type RuntimeEnv,
|
||||||
|
} from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { normalizeStringEntries } from "openclaw/plugin-sdk/text-runtime";
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/text-runtime";
|
||||||
import { normalizeE164 } from "openclaw/plugin-sdk/text-runtime";
|
import { normalizeE164 } from "openclaw/plugin-sdk/text-runtime";
|
||||||
import { resolveSignalAccount } from "./accounts.js";
|
import { resolveSignalAccount } from "./accounts.js";
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import type { BackoffPolicy } from "openclaw/plugin-sdk/infra-runtime";
|
import {
|
||||||
import { computeBackoff, sleepWithAbort } from "openclaw/plugin-sdk/infra-runtime";
|
computeBackoff,
|
||||||
import { logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
logVerbose,
|
||||||
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
shouldLogVerbose,
|
||||||
|
sleepWithAbort,
|
||||||
|
type BackoffPolicy,
|
||||||
|
type RuntimeEnv,
|
||||||
|
} from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { type SignalSseEvent, streamSignalEvents } from "./client.js";
|
import { type SignalSseEvent, streamSignalEvents } from "./client.js";
|
||||||
|
|
||||||
const DEFAULT_RECONNECT_POLICY: BackoffPolicy = {
|
const DEFAULT_RECONNECT_POLICY: BackoffPolicy = {
|
||||||
|
|||||||
@@ -16,13 +16,17 @@ import {
|
|||||||
} from "openclaw/plugin-sdk/config-runtime";
|
} from "openclaw/plugin-sdk/config-runtime";
|
||||||
import type { SessionScope } from "openclaw/plugin-sdk/config-runtime";
|
import type { SessionScope } from "openclaw/plugin-sdk/config-runtime";
|
||||||
import { createConnectedChannelStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
import { createConnectedChannelStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
||||||
import { computeBackoff, sleepWithAbort } from "openclaw/plugin-sdk/infra-runtime";
|
|
||||||
import { installRequestBodyLimitGuard } from "openclaw/plugin-sdk/infra-runtime";
|
import { installRequestBodyLimitGuard } from "openclaw/plugin-sdk/infra-runtime";
|
||||||
import { DEFAULT_GROUP_HISTORY_LIMIT } from "openclaw/plugin-sdk/reply-history";
|
import { DEFAULT_GROUP_HISTORY_LIMIT } from "openclaw/plugin-sdk/reply-history";
|
||||||
import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-runtime";
|
import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-runtime";
|
||||||
import { normalizeMainKey } from "openclaw/plugin-sdk/routing";
|
import { normalizeMainKey } from "openclaw/plugin-sdk/routing";
|
||||||
import { warn } from "openclaw/plugin-sdk/runtime-env";
|
import { warn } from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { createNonExitingRuntime, type RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
import {
|
||||||
|
computeBackoff,
|
||||||
|
createNonExitingRuntime,
|
||||||
|
sleepWithAbort,
|
||||||
|
type RuntimeEnv,
|
||||||
|
} from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
||||||
import { normalizeStringEntries } from "openclaw/plugin-sdk/text-runtime";
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/text-runtime";
|
||||||
import { resolveSlackAccount } from "../accounts.js";
|
import { resolveSlackAccount } from "../accounts.js";
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|||||||
import { waitForever } from "openclaw/plugin-sdk/cli-runtime";
|
import { waitForever } from "openclaw/plugin-sdk/cli-runtime";
|
||||||
import { hasControlCommand } from "openclaw/plugin-sdk/command-auth";
|
import { hasControlCommand } from "openclaw/plugin-sdk/command-auth";
|
||||||
import { loadConfig } from "openclaw/plugin-sdk/config-runtime";
|
import { loadConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||||
import { formatDurationPrecise } from "openclaw/plugin-sdk/infra-runtime";
|
|
||||||
import { enqueueSystemEvent } from "openclaw/plugin-sdk/infra-runtime";
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/infra-runtime";
|
||||||
import { DEFAULT_GROUP_HISTORY_LIMIT } from "openclaw/plugin-sdk/reply-history";
|
import { DEFAULT_GROUP_HISTORY_LIMIT } from "openclaw/plugin-sdk/reply-history";
|
||||||
import { getReplyFromConfig } from "openclaw/plugin-sdk/reply-runtime";
|
import { getReplyFromConfig } from "openclaw/plugin-sdk/reply-runtime";
|
||||||
@@ -11,7 +10,11 @@ import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|||||||
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { registerUnhandledRejectionHandler } from "openclaw/plugin-sdk/runtime-env";
|
import { registerUnhandledRejectionHandler } from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { getChildLogger } from "openclaw/plugin-sdk/runtime-env";
|
import { getChildLogger } from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { defaultRuntime, type RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
import {
|
||||||
|
defaultRuntime,
|
||||||
|
formatDurationPrecise,
|
||||||
|
type RuntimeEnv,
|
||||||
|
} from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { resolveWhatsAppAccount, resolveWhatsAppMediaMaxBytes } from "../accounts.js";
|
import { resolveWhatsAppAccount, resolveWhatsAppMediaMaxBytes } from "../accounts.js";
|
||||||
import { setActiveWebListener } from "../active-listener.js";
|
import { setActiveWebListener } from "../active-listener.js";
|
||||||
import { monitorWebInbox } from "../inbound.js";
|
import { monitorWebInbox } from "../inbound.js";
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { randomUUID } from "node:crypto";
|
import { randomUUID } from "node:crypto";
|
||||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||||
import type { BackoffPolicy } from "openclaw/plugin-sdk/infra-runtime";
|
import {
|
||||||
import { computeBackoff, sleepWithAbort } from "openclaw/plugin-sdk/infra-runtime";
|
computeBackoff,
|
||||||
|
sleepWithAbort,
|
||||||
|
type BackoffPolicy,
|
||||||
|
} from "openclaw/plugin-sdk/runtime-env";
|
||||||
import { clamp } from "openclaw/plugin-sdk/text-runtime";
|
import { clamp } from "openclaw/plugin-sdk/text-runtime";
|
||||||
|
|
||||||
export type ReconnectPolicy = BackoffPolicy & {
|
export type ReconnectPolicy = BackoffPolicy & {
|
||||||
|
|||||||
Reference in New Issue
Block a user