refactor: trim guard helper exports · openclaw/openclaw@cb4cdaf
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,8 +4,8 @@ import { findNormalizedProviderValue } from "./provider-id.js";
|
4 | 4 | |
5 | 5 | export const CONTEXT_WINDOW_HARD_MIN_TOKENS = 4_000; |
6 | 6 | export const CONTEXT_WINDOW_WARN_BELOW_TOKENS = 8_000; |
7 | | -export const CONTEXT_WINDOW_HARD_MIN_RATIO = 0.1; |
8 | | -export const CONTEXT_WINDOW_WARN_BELOW_RATIO = 0.2; |
| 7 | +const CONTEXT_WINDOW_HARD_MIN_RATIO = 0.1; |
| 8 | +const CONTEXT_WINDOW_WARN_BELOW_RATIO = 0.2; |
9 | 9 | |
10 | 10 | export type ContextWindowSource = "model" | "modelsConfig" | "agentContextTokens" | "default"; |
11 | 11 | |
@@ -79,7 +79,7 @@ export type ContextWindowGuardHint = {
|
79 | 79 | likelySelfHosted: boolean; |
80 | 80 | }; |
81 | 81 | |
82 | | -export function resolveContextWindowGuardHint(params: { |
| 82 | +function resolveContextWindowGuardHint(params: { |
83 | 83 | runtimeBaseUrl?: string | null; |
84 | 84 | }): ContextWindowGuardHint { |
85 | 85 | const endpoint = resolveProviderEndpoint(params.runtimeBaseUrl ?? undefined); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -120,7 +120,7 @@ export function resolveSubagentCapabilityStore(
|
120 | 120 | return readSessionStore(storePath); |
121 | 121 | } |
122 | 122 | |
123 | | -export function resolveSubagentRoleForDepth(params: { |
| 123 | +function resolveSubagentRoleForDepth(params: { |
124 | 124 | depth: number; |
125 | 125 | maxSpawnDepth?: number; |
126 | 126 | }): SubagentSessionRole { |
@@ -135,9 +135,7 @@ export function resolveSubagentRoleForDepth(params: {
|
135 | 135 | return depth < maxSpawnDepth ? "orchestrator" : "leaf"; |
136 | 136 | } |
137 | 137 | |
138 | | -export function resolveSubagentControlScopeForRole( |
139 | | -role: SubagentSessionRole, |
140 | | -): SubagentControlScope { |
| 138 | +function resolveSubagentControlScopeForRole(role: SubagentSessionRole): SubagentControlScope { |
141 | 139 | return role === "leaf" ? "none" : "children"; |
142 | 140 | } |
143 | 141 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。