From e62b0122e7ad3fa9a8a4412506fa0de0b42e92b7 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 17 Jun 2026 08:34:37 +0800 Subject: [PATCH] refactor(agents): narrow embedded runner helper exports --- .../embedded-agent-runner/run/idle-timeout-breaker.ts | 6 +++--- src/agents/embedded-agent-runner/run/images.ts | 2 +- src/agents/embedded-agent-runner/tool-result-truncation.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/agents/embedded-agent-runner/run/idle-timeout-breaker.ts b/src/agents/embedded-agent-runner/run/idle-timeout-breaker.ts index 425b31099fcc..565a3f97b3cf 100644 --- a/src/agents/embedded-agent-runner/run/idle-timeout-breaker.ts +++ b/src/agents/embedded-agent-runner/run/idle-timeout-breaker.ts @@ -16,7 +16,7 @@ export const MAX_CONSECUTIVE_IDLE_TIMEOUTS_BEFORE_OUTPUT = 5; /** Mutable outer-loop state that survives across retry/profile attempts. */ -export type IdleTimeoutBreakerState = { +type IdleTimeoutBreakerState = { consecutiveIdleTimeoutsBeforeOutput: number; }; @@ -30,14 +30,14 @@ export function createIdleTimeoutBreakerState(): IdleTimeoutBreakerState { * model progress means durable text/tool-call progress, not merely billed token * deltas from a partial stream. */ -export type IdleTimeoutBreakerInput = { +type IdleTimeoutBreakerInput = { idleTimedOut: boolean; completedModelProgress: boolean; outputTokens?: number; }; /** Result of applying one attempt outcome to the breaker state. */ -export type IdleTimeoutBreakerStep = { +type IdleTimeoutBreakerStep = { consecutive: number; tripped: boolean; }; diff --git a/src/agents/embedded-agent-runner/run/images.ts b/src/agents/embedded-agent-runner/run/images.ts index bece363407fe..7727732da8ac 100644 --- a/src/agents/embedded-agent-runner/run/images.ts +++ b/src/agents/embedded-agent-runner/run/images.ts @@ -83,7 +83,7 @@ const MEDIA_URI_REGEX = /\bmedia:\/\/inbound\/([^\]\s/\\]+)/; /** * Result of detecting an image reference in text. */ -export interface DetectedImageRef { +interface DetectedImageRef { /** The raw matched string from the prompt */ raw: string; /** The type of reference */ diff --git a/src/agents/embedded-agent-runner/tool-result-truncation.ts b/src/agents/embedded-agent-runner/tool-result-truncation.ts index 09cb37102e92..8bc3f6632bf5 100644 --- a/src/agents/embedded-agent-runner/tool-result-truncation.ts +++ b/src/agents/embedded-agent-runner/tool-result-truncation.ts @@ -45,8 +45,8 @@ const MAX_TOOL_RESULT_CONTEXT_SHARE = 0.3; * request-local ceiling so oversized tool output cannot dominate the next turn. */ export const DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS = 16_000; -export const LARGE_CONTEXT_MAX_LIVE_TOOL_RESULT_CHARS = 32_000; -export const XL_CONTEXT_MAX_LIVE_TOOL_RESULT_CHARS = 64_000; +const LARGE_CONTEXT_MAX_LIVE_TOOL_RESULT_CHARS = 32_000; +const XL_CONTEXT_MAX_LIVE_TOOL_RESULT_CHARS = 64_000; const LARGE_CONTEXT_TOOL_RESULT_TOKENS = 100_000; const XL_CONTEXT_TOOL_RESULT_TOKENS = 200_000; @@ -389,7 +389,7 @@ function calculateRecoveryAggregateToolResultChars( ); } -export type ToolResultReductionPotential = { +type ToolResultReductionPotential = { maxChars: number; aggregateBudgetChars: number; toolResultCount: number;