e45c9300bf
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>
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import {
|
|
MEMORY_INTERVENTION_LIMIT,
|
|
MEMORY_INTERVENTION_MODE,
|
|
memoryLimitForIntervention,
|
|
resolveMemoryInterventionMode,
|
|
} from './memory-intervention.mjs';
|
|
|
|
test('resolveMemoryInterventionMode uses heavy only for deep reasoning', () => {
|
|
assert.equal(
|
|
resolveMemoryInterventionMode({ forceDeepReasoning: true, context: 'agent' }),
|
|
MEMORY_INTERVENTION_MODE.HEAVY,
|
|
);
|
|
assert.equal(
|
|
resolveMemoryInterventionMode({ recallQuestion: true, context: 'router' }),
|
|
MEMORY_INTERVENTION_MODE.LIGHT,
|
|
);
|
|
assert.equal(resolveMemoryInterventionMode({ context: 'router' }), MEMORY_INTERVENTION_MODE.SKIP);
|
|
assert.equal(resolveMemoryInterventionMode({ context: 'agent' }), MEMORY_INTERVENTION_MODE.LIGHT);
|
|
});
|
|
|
|
test('memoryLimitForIntervention maps modes to bounded limits', () => {
|
|
assert.equal(memoryLimitForIntervention(MEMORY_INTERVENTION_MODE.SKIP), 0);
|
|
assert.equal(
|
|
memoryLimitForIntervention(MEMORY_INTERVENTION_MODE.HEAVY, { context: 'agent' }),
|
|
MEMORY_INTERVENTION_LIMIT.HEAVY,
|
|
);
|
|
assert.equal(
|
|
memoryLimitForIntervention(MEMORY_INTERVENTION_MODE.LIGHT, { context: 'direct_chat' }),
|
|
MEMORY_INTERVENTION_LIMIT.LIGHT_DIRECT_CHAT,
|
|
);
|
|
assert.equal(
|
|
memoryLimitForIntervention(MEMORY_INTERVENTION_MODE.LIGHT, { context: 'agent' }),
|
|
MEMORY_INTERVENTION_LIMIT.LIGHT_AGENT,
|
|
);
|
|
});
|