MCPcopy Index your code
hub / github.com/codeaashu/claude-code / applyToolResultBudget

Function applyToolResultBudget

src/utils/toolResultStorage.ts:924–936  ·  view source on GitHub ↗
(
  messages: Message[],
  state: ContentReplacementState | undefined,
  writeToTranscript?: (records: ToolResultReplacementRecord[]) => void,
  skipToolNames?: ReadonlySet<string>,
)

Source from the content-addressed store, hash-verified

922 * when the feature is off or no replacement occurred.
923 */
924export async function applyToolResultBudget(
925 messages: Message[],
926 state: ContentReplacementState | undefined,
927 writeToTranscript?: (records: ToolResultReplacementRecord[]) => void,
928 skipToolNames?: ReadonlySet<string>,
929): Promise<Message[]> {
930 if (!state) return messages
931 const result = await enforceToolResultBudget(messages, state, skipToolNames)
932 if (result.newlyReplaced.length > 0) {
933 writeToTranscript?.(result.newlyReplaced)
934 }
935 return result.messages
936}
937
938/**
939 * Reconstruct replacement state from content-replacement records loaded from

Callers 1

queryLoopFunction · 0.85

Calls 1

enforceToolResultBudgetFunction · 0.85

Tested by

no test coverage detected