diff --git a/src/mcplocal/src/gate/llm-selector.ts b/src/mcplocal/src/gate/llm-selector.ts index c857351..45fe2b0 100644 --- a/src/mcplocal/src/gate/llm-selector.ts +++ b/src/mcplocal/src/gate/llm-selector.ts @@ -95,7 +95,11 @@ export class LlmPromptSelector { ): Promise { const { getSystemPromptFn, signal, serverInfer } = opts; - const DEFAULT_SYSTEM_PROMPT = `You are a context selection assistant. Given a developer's task keywords and a list of available project prompts, select which prompts are relevant to their work. Return a JSON object with "selectedNames" (array of prompt names) and "reasoning" (brief explanation). Priority 10 prompts must always be included.`; + // Keep the answer SHORT: latency is proportional to output length (a + // no-think model runs ~10-13 tok/s), and a verbose reasoning field pushes a + // selection past the gate's responsiveness budget. Ask for compact JSON with + // a <=8-word reasoning — ~2s vs ~9s for a prose reasoning. + const DEFAULT_SYSTEM_PROMPT = `You are a context selection assistant. Given a developer's task keywords and available project prompts, select the relevant ones. Return ONLY compact JSON: {"selectedNames":[...],"reasoning":"<=8 words"}. No prose outside the JSON. Priority 10 prompts must always be included.`; const systemPrompt = getSystemPromptFn ? await getSystemPromptFn('llm-gate-context-selector', DEFAULT_SYSTEM_PROMPT) : DEFAULT_SYSTEM_PROMPT;