feat(gate): terse selection prompt (~2s) (#89)
Some checks failed
CI/CD / typecheck (push) Successful in 1m4s
CI/CD / lint (push) Successful in 2m8s
CI/CD / test (push) Successful in 1m20s
CI/CD / smoke (push) Failing after 1m51s
CI/CD / build (push) Successful in 4m7s
CI/CD / publish (push) Has been skipped

This commit was merged in pull request #89.
This commit is contained in:
2026-07-24 20:38:32 +00:00

View File

@@ -95,7 +95,11 @@ export class LlmPromptSelector {
): Promise<LlmSelectionResult> { ): Promise<LlmSelectionResult> {
const { getSystemPromptFn, signal, serverInfer } = opts; 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 const systemPrompt = getSystemPromptFn
? await getSystemPromptFn('llm-gate-context-selector', DEFAULT_SYSTEM_PROMPT) ? await getSystemPromptFn('llm-gate-context-selector', DEFAULT_SYSTEM_PROMPT)
: DEFAULT_SYSTEM_PROMPT; : DEFAULT_SYSTEM_PROMPT;