mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:50:43 +00:00
refactor: trim guard helper exports
This commit is contained in:
@@ -4,8 +4,8 @@ import { findNormalizedProviderValue } from "./provider-id.js";
|
||||
|
||||
export const CONTEXT_WINDOW_HARD_MIN_TOKENS = 4_000;
|
||||
export const CONTEXT_WINDOW_WARN_BELOW_TOKENS = 8_000;
|
||||
export const CONTEXT_WINDOW_HARD_MIN_RATIO = 0.1;
|
||||
export const CONTEXT_WINDOW_WARN_BELOW_RATIO = 0.2;
|
||||
const CONTEXT_WINDOW_HARD_MIN_RATIO = 0.1;
|
||||
const CONTEXT_WINDOW_WARN_BELOW_RATIO = 0.2;
|
||||
|
||||
export type ContextWindowSource = "model" | "modelsConfig" | "agentContextTokens" | "default";
|
||||
|
||||
@@ -79,7 +79,7 @@ export type ContextWindowGuardHint = {
|
||||
likelySelfHosted: boolean;
|
||||
};
|
||||
|
||||
export function resolveContextWindowGuardHint(params: {
|
||||
function resolveContextWindowGuardHint(params: {
|
||||
runtimeBaseUrl?: string | null;
|
||||
}): ContextWindowGuardHint {
|
||||
const endpoint = resolveProviderEndpoint(params.runtimeBaseUrl ?? undefined);
|
||||
|
||||
@@ -120,7 +120,7 @@ export function resolveSubagentCapabilityStore(
|
||||
return readSessionStore(storePath);
|
||||
}
|
||||
|
||||
export function resolveSubagentRoleForDepth(params: {
|
||||
function resolveSubagentRoleForDepth(params: {
|
||||
depth: number;
|
||||
maxSpawnDepth?: number;
|
||||
}): SubagentSessionRole {
|
||||
@@ -135,9 +135,7 @@ export function resolveSubagentRoleForDepth(params: {
|
||||
return depth < maxSpawnDepth ? "orchestrator" : "leaf";
|
||||
}
|
||||
|
||||
export function resolveSubagentControlScopeForRole(
|
||||
role: SubagentSessionRole,
|
||||
): SubagentControlScope {
|
||||
function resolveSubagentControlScopeForRole(role: SubagentSessionRole): SubagentControlScope {
|
||||
return role === "leaf" ? "none" : "children";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user