fix(plugin): scope synthetic-idle dedup bypass to matching marker
Only clear recentAnyIdles when the stored marker matches the synthetic idle timestamp for the same session, preventing accidental clobbering of newer idle markers. Add a regression test to verify other sessions keep their dedup state during this bypass path. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+4
-1
@@ -417,7 +417,10 @@ export function createEventHandler(args: {
|
||||
recentSyntheticIdles.delete(sessionID);
|
||||
// Let real idle events through even when a synthetic idle fired moments earlier.
|
||||
// OpenCode diagnostics expect a concrete session.idle event signal.
|
||||
recentAnyIdles.delete(sessionID);
|
||||
const lastAnyIdleAt = recentAnyIdles.get(sessionID);
|
||||
if (lastAnyIdleAt === emittedAt) {
|
||||
recentAnyIdles.delete(sessionID);
|
||||
}
|
||||
}
|
||||
recentRealIdles.set(sessionID, now);
|
||||
if (!shouldDispatchIdleEvent(sessionID, now)) {
|
||||
|
||||
Reference in New Issue
Block a user