/** * Nudge prompts injected into messages when context usage exceeds thresholds. * All wrapped in tags — the model is trained to strip these. */ /** Injected when context exceeds maxContextPercent. Urgent. */ export const CONTEXT_LIMIT_NUDGE = ` CRITICAL WARNING: MAX CONTEXT LIMIT REACHED You are at or beyond the configured max context threshold. This is an emergency context-recovery moment. You MUST use the \`compress\` tool now. Do not continue normal exploration until compression is handled. If you are in the middle of a critical atomic operation, finish that atomic step first, then compress immediately. SELECTION PROCESS Start from older, resolved history and capture as much stale context as safely possible in one pass. Avoid the newest active working messages unless it is clearly closed. SUMMARY REQUIREMENTS Your summary MUST cover all essential details from the selected messages so work can continue. If the compressed range includes user messages, preserve user intent exactly. Prefer direct quotes for short user messages to avoid semantic drift. `; /** Injected on user turns when context is between minContextPercent and maxContextPercent. Moderate. */ export const TURN_NUDGE = ` Evaluate the conversation for compressible ranges. If any messages are cleanly closed and unlikely to be needed again, use the compress tool on them. If direction has shifted, compress earlier ranges that are now less relevant. The goal is to filter noise and distill key information so context accumulation stays under control. Keep active context uncompressed. `; /** Injected after many assistant iterations without a user message. Moderate. */ export const ITERATION_NUDGE = ` You've been iterating for a while after the last user message. If there is a closed portion that is unlikely to be referenced immediately (for example, finished research before implementation), use the compress tool on it now. `;