feat: LLM intent router, direct chat execution, and Memory V2 light intervention
Wire chat intent routing with direct_chat on regular sessions, skill-selected short-circuit to Agent, memory light/heavy intervention tiers, and fix direct chat UI stuck streaming after completion. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
export const MEMORY_INTERVENTION_MODE = {
|
||||
SKIP: 'skip',
|
||||
LIGHT: 'light',
|
||||
HEAVY: 'heavy',
|
||||
};
|
||||
|
||||
export const MEMORY_INTERVENTION_LIMIT = {
|
||||
LIGHT_ROUTER: 3,
|
||||
LIGHT_DIRECT_CHAT: 5,
|
||||
LIGHT_AGENT: 3,
|
||||
HEAVY: 40,
|
||||
};
|
||||
|
||||
export function resolveMemoryInterventionMode({
|
||||
forceDeepReasoning = false,
|
||||
recallQuestion = false,
|
||||
context = 'router',
|
||||
} = {}) {
|
||||
if (forceDeepReasoning) return MEMORY_INTERVENTION_MODE.HEAVY;
|
||||
if (context === 'router') {
|
||||
return recallQuestion ? MEMORY_INTERVENTION_MODE.LIGHT : MEMORY_INTERVENTION_MODE.SKIP;
|
||||
}
|
||||
return MEMORY_INTERVENTION_MODE.LIGHT;
|
||||
}
|
||||
|
||||
export function memoryLimitForIntervention(mode, { context = 'router' } = {}) {
|
||||
if (mode === MEMORY_INTERVENTION_MODE.HEAVY) {
|
||||
return MEMORY_INTERVENTION_LIMIT.HEAVY;
|
||||
}
|
||||
if (mode === MEMORY_INTERVENTION_MODE.SKIP) {
|
||||
return 0;
|
||||
}
|
||||
if (context === 'direct_chat') {
|
||||
return MEMORY_INTERVENTION_LIMIT.LIGHT_DIRECT_CHAT;
|
||||
}
|
||||
if (context === 'agent') {
|
||||
return MEMORY_INTERVENTION_LIMIT.LIGHT_AGENT;
|
||||
}
|
||||
return MEMORY_INTERVENTION_LIMIT.LIGHT_ROUTER;
|
||||
}
|
||||
Reference in New Issue
Block a user