MCPcopy
hub / github.com/codeaashu/claude-code / buildCacheSafeParams

Function buildCacheSafeParams

src/commands/btw/btw.tsx:208–228  ·  view source on GitHub ↗
(context: ProcessUserInputContext)

Source from the content-addressed store, hash-verified

206 return messages;
207}
208async function buildCacheSafeParams(context: ProcessUserInputContext): Promise<CacheSafeParams> {
209 const forkContextMessages = getMessagesAfterCompactBoundary(stripInProgressAssistantMessage(context.messages));
210 const saved = getLastCacheSafeParams();
211 if (saved) {
212 return {
213 systemPrompt: saved.systemPrompt,
214 userContext: saved.userContext,
215 systemContext: saved.systemContext,
216 toolUseContext: context,
217 forkContextMessages
218 };
219 }
220 const [rawSystemPrompt, userContext, systemContext] = await Promise.all([getSystemPrompt(context.options.tools, context.options.mainLoopModel, [], context.options.mcpClients), getUserContext(), getSystemContext()]);
221 return {
222 systemPrompt: asSystemPrompt(rawSystemPrompt),
223 userContext,
224 systemContext,
225 toolUseContext: context,
226 forkContextMessages
227 };
228}
229export async function call(onDone: LocalJSXCommandOnDone, context: ProcessUserInputContext, args: string): Promise<React.ReactNode> {
230 const question = args?.trim();
231 if (!question) {

Callers 1

fetchResponseFunction · 0.85

Calls 5

getLastCacheSafeParamsFunction · 0.85
asSystemPromptFunction · 0.85
getSystemPromptFunction · 0.50

Tested by

no test coverage detected