fix(reminder-hooks): preserve suppression state across compaction

This commit is contained in:
Disaster-Terminator
2026-04-18 09:40:09 +08:00
committed by YeonGyu-Kim
parent ae7ff3bb7e
commit 3db1da1e5b
4 changed files with 108 additions and 16 deletions
+3 -7
View File
@@ -42,6 +42,8 @@ const ORCHESTRATOR_AGENTS = new Set([
"prometheus",
]);
const MAX_REMINDERS = 3;
function isOrchestratorAgent(agentName: string): boolean {
return ORCHESTRATOR_AGENTS.has(getAgentConfigKey(agentName));
}
@@ -99,7 +101,7 @@ export function createAgentUsageReminderHook(_ctx: PluginInput) {
const state = getOrCreateState(sessionID);
if (state.agentUsed) {
if (state.agentUsed || state.reminderCount >= MAX_REMINDERS) {
return;
}
@@ -119,12 +121,6 @@ export function createAgentUsageReminderHook(_ctx: PluginInput) {
}
}
if (event.type === "session.compacted") {
const sessionID = resolveSessionEventID(props);
if (sessionID) {
resetState(sessionID);
}
}
};
return {