fix: deliver compaction.notifyUser notices via routeReply when no active turn#88979
fix: deliver compaction.notifyUser notices via routeReply when no active turn#88979yichu10c wants to merge 1 commit into
Conversation
When compaction.notifyUser is enabled but no active streaming turn callback (onBlockReply) is available, sendCompactionNotice now falls back to routing the notice through the canonical session outbound path (routeReply) instead of silently returning. This fixes the issue where async/preflight compactions (triggered outside of active inbound-driven streaming reply turns) produce no user-visible notice even when notifyUser: true is configured. Fixes openclaw#88933
|
Codex review: needs real behavior proof before merge. Reviewed June 1, 2026, 3:21 AM ET / 07:21 UTC. Summary PR surface: Source +38. Total +38 across 1 file. Reproducibility: yes. source-level reproduction is high confidence: current main returns from Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Use the same effective origin/session delivery route as final replies, handle Do we have a high-confidence way to reproduce the issue? Yes, source-level reproduction is high confidence: current main returns from Is this the best way to solve the issue? No. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 5e09113edec4. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +38. Total +38 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Fixes #88933
Summary
When
agents.defaults.compaction.notifyUser: trueis configured but no active streaming turn callback (onBlockReply) is available,sendCompactionNoticenow falls back to routing the notice through the canonical session outbound path (routeReply) instead of silently returning early.This fixes the issue where async/preflight compactions (triggered outside of active inbound-driven streaming reply turns — e.g. proactive
maxHistorySharecompactions, subagent-completion auto-announce compactions) produce no user-visible notice even whennotifyUser: trueis configured.Root cause
sendCompactionNoticewas guarded by an earlyreturnwhenparams.opts?.onBlockReplywas absent. All three call sites (start/end/incomplete phases) go through this guard, so any compaction without an active streaming turn silently skips notification.Fix
The fix adds a fallback delivery path:
onBlockReplywhen availableonBlockReplyis absent butnotifyUseris enabled, route the notice throughrouteReplyusing the session's channel/surface infoThe fallback only activates when:
notifyUseristruein runtime configchannel(Surface ?? Provider)toaddress (OriginatingTo ?? To)Errors in both paths are caught and logged as non-fatal (fire-and-forget semantics preserved).
Tests
All 152 tests in
src/auto-reply/reply/agent-runner-execution.test.tspass, including the 9 compaction-related tests:Review notes
clawsweeper:fix-shape-clearandclawsweeper:queueable-fix— the fix follows the identified canonical delivery seam (routeReply→sendDurableMessageBatch).ReplyDispatchKind.blockfor compaction notices, consistent with their transient/status semantics.onBlockReplyfallback path for completeness.