mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:21:24 +00:00
fix(hooks): suppress main session events for silent/delivered hook turns (#20678)
* fix(hooks): suppress main session events for silent/delivered hook turns When a hook agent turn returns NO_REPLY (SILENT_REPLY_TOKEN), mark the result as delivered so the hooks handler skips enqueueSystemEvent and requestHeartbeatNow. Without this, every Gmail notification classified as NO_REPLY still injects a system event into the main agent session, causing context window growth proportional to email volume. Two-part fix: - cron/isolated-agent/run.ts: set delivered:true when synthesizedText matches SILENT_REPLY_TOKEN so callers know no notification is needed - gateway/server/hooks.ts: guard enqueueSystemEvent + requestHeartbeatNow with !result.delivered (addresses duplicate delivery, refs #20196) Refs: https://github.com/openclaw/openclaw/issues/20196 * Changelog: document hook silent-delivery suppression fix --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -753,7 +753,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
return withRunSession({ status: "ok", summary, outputText, ...telemetry });
|
||||
}
|
||||
if (synthesizedText.toUpperCase() === SILENT_REPLY_TOKEN.toUpperCase()) {
|
||||
return withRunSession({ status: "ok", summary, outputText, ...telemetry });
|
||||
return withRunSession({ status: "ok", summary, outputText, delivered: true, ...telemetry });
|
||||
}
|
||||
try {
|
||||
const didAnnounce = await runSubagentAnnounceFlow({
|
||||
|
||||
Reference in New Issue
Block a user