refactor: trim embedded runner helper exports

This commit is contained in:
Peter Steinberger
2026-05-02 06:45:04 +01:00
parent 0989f09324
commit 40ed9eb830
5 changed files with 4 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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.]`;
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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,