chore: set continuation interval to 10s; restart per-user timer on message
This commit is contained in:
10
src/bot.js
10
src/bot.js
@@ -409,6 +409,16 @@ client.on('messageCreate', async (message) => {
|
|||||||
|
|
||||||
await appendShortTerm(userId, 'user', cleaned);
|
await appendShortTerm(userId, 'user', cleaned);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const state = continuationState.get(userId);
|
||||||
|
if (state) {
|
||||||
|
state.lastUserTs = Date.now();
|
||||||
|
continuationState.set(userId, state);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.warn('[bot] Failed to reset continuation timer:', err);
|
||||||
|
}
|
||||||
|
|
||||||
// If the user indicates they are leaving, stop proactive continuation
|
// If the user indicates they are leaving, stop proactive continuation
|
||||||
if (stopCueRegex.test(cleaned)) {
|
if (stopCueRegex.test(cleaned)) {
|
||||||
stopContinuationForUser(userId);
|
stopContinuationForUser(userId);
|
||||||
|
|||||||
@@ -39,6 +39,6 @@ export const config = {
|
|||||||
// Proactive continuation settings: when a user stops replying, Nova can continue
|
// Proactive continuation settings: when a user stops replying, Nova can continue
|
||||||
// the conversation every `continuationIntervalMs` milliseconds until the user
|
// the conversation every `continuationIntervalMs` milliseconds until the user
|
||||||
// signals to stop or the `continuationMaxProactive` limit is reached.
|
// signals to stop or the `continuationMaxProactive` limit is reached.
|
||||||
continuationIntervalMs: process.env.CONTINUATION_INTERVAL_MS ? parseInt(process.env.CONTINUATION_INTERVAL_MS, 10) : 15000,
|
continuationIntervalMs: process.env.CONTINUATION_INTERVAL_MS ? parseInt(process.env.CONTINUATION_INTERVAL_MS, 10) : 10000,
|
||||||
continuationMaxProactive: process.env.CONTINUATION_MAX_PROACTIVE ? parseInt(process.env.CONTINUATION_MAX_PROACTIVE, 10) : 10,
|
continuationMaxProactive: process.env.CONTINUATION_MAX_PROACTIVE ? parseInt(process.env.CONTINUATION_MAX_PROACTIVE, 10) : 10,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user