({
tools,
mainLoopModel,
additionalWorkingDirectories,
mcpClients,
customSystemPrompt,
}: {
tools: Tools
mainLoopModel: string
additionalWorkingDirectories: string[]
mcpClients: MCPServerConnection[]
customSystemPrompt: string | undefined
})
| 42 | * sideQuestion's fallback uses the base result directly. |
| 43 | */ |
| 44 | export async function fetchSystemPromptParts({ |
| 45 | tools, |
| 46 | mainLoopModel, |
| 47 | additionalWorkingDirectories, |
| 48 | mcpClients, |
| 49 | customSystemPrompt, |
| 50 | }: { |
| 51 | tools: Tools |
| 52 | mainLoopModel: string |
| 53 | additionalWorkingDirectories: string[] |
| 54 | mcpClients: MCPServerConnection[] |
| 55 | customSystemPrompt: string | undefined |
| 56 | }): Promise<{ |
| 57 | defaultSystemPrompt: string[] |
| 58 | userContext: { [k: string]: string } |
| 59 | systemContext: { [k: string]: string } |
| 60 | }> { |
| 61 | const [defaultSystemPrompt, userContext, systemContext] = await Promise.all([ |
| 62 | customSystemPrompt !== undefined |
| 63 | ? Promise.resolve([]) |
| 64 | : getSystemPrompt( |
| 65 | tools, |
| 66 | mainLoopModel, |
| 67 | additionalWorkingDirectories, |
| 68 | mcpClients, |
| 69 | ), |
| 70 | getUserContext(), |
| 71 | customSystemPrompt !== undefined ? Promise.resolve({}) : getSystemContext(), |
| 72 | ]) |
| 73 | return { defaultSystemPrompt, userContext, systemContext } |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Build CacheSafeParams from raw inputs when getLastCacheSafeParams() is null. |
no test coverage detected