mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:30:43 +00:00
refactor: trim embedded runner helper exports
This commit is contained in:
@@ -24,7 +24,7 @@ function isZero(value: number | undefined): value is 0 {
|
||||
return value === 0;
|
||||
}
|
||||
|
||||
export function hasZeroTokenUsageSnapshot(usage: unknown): boolean {
|
||||
function hasZeroTokenUsageSnapshot(usage: unknown): boolean {
|
||||
if (!usage || typeof usage !== "object") {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const SESSIONS_YIELD_CONTEXT_CUSTOM_TYPE = "openclaw.sessions_yield";
|
||||
const SESSIONS_YIELD_ABORT_SETTLE_TIMEOUT_MS = process.env.OPENCLAW_TEST_FAST === "1" ? 250 : 2_000;
|
||||
|
||||
// Persist a hidden context reminder so the next turn knows why the runner stopped.
|
||||
export function buildSessionsYieldContextMessage(message: string): string {
|
||||
function buildSessionsYieldContextMessage(message: string): string {
|
||||
return `${message}\n\n[Context: The previous turn ended intentionally via sessions_yield while waiting for a follow-up event.]`;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export function shouldUseOpenAIWebSocketTransport(params: {
|
||||
return endpointClass === "default" || endpointClass === "openai-public";
|
||||
}
|
||||
|
||||
export function shouldAppendAttemptCacheTtl(params: {
|
||||
function shouldAppendAttemptCacheTtl(params: {
|
||||
timedOutDuringCompaction: boolean;
|
||||
compactionOccurredThisAttempt: boolean;
|
||||
config?: OpenClawConfig;
|
||||
|
||||
@@ -88,10 +88,6 @@ export function trackSessionManagerAccess(sessionFile: string): void {
|
||||
sessionManagerCache.trackSessionManagerAccess(sessionFile);
|
||||
}
|
||||
|
||||
export function isSessionManagerCached(sessionFile: string): boolean {
|
||||
return sessionManagerCache.isSessionManagerCached(sessionFile);
|
||||
}
|
||||
|
||||
export async function prewarmSessionFile(sessionFile: string): Promise<void> {
|
||||
await sessionManagerCache.prewarmSessionFile(sessionFile);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ type ToolResultFlushManager = {
|
||||
clearPendingToolResults?: (() => void) | undefined;
|
||||
};
|
||||
|
||||
export const DEFAULT_WAIT_FOR_IDLE_TIMEOUT_MS = 30_000;
|
||||
const DEFAULT_WAIT_FOR_IDLE_TIMEOUT_MS = 30_000;
|
||||
|
||||
async function waitForAgentIdleBestEffort(
|
||||
agent: IdleAwareAgent | null | undefined,
|
||||
|
||||
Reference in New Issue
Block a user