Repository navigation
fix(agents): prevent false reminder warnings after compaction - #128581
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 3:10 AM ET / 07:10 UTC. ClawSweeper reviewWhat this changesThe PR stops compaction retries from clearing successful cron-add evidence and strengthens the embedded-session regression test for that sequence. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for maintainer review. The patch correctly preserves a successful cron-add fact through compaction, but the linked issue also describes a separate prior-turn isolated-session cron case that the unchanged session-key lookup does not cover. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherEmbedded agent subscriptions collect tool outcomes while a turn runs; compaction resets transient presentation state before a retry. The final agent-run result passes successful cron evidence to the auto-reply reminder guard, which decides whether to append a warning to the user reply. flowchart LR
A[Successful cron tool event] --> B[Embedded agent subscription]
B --> C[Compaction retry]
C --> D[Reset presentation state]
B --> E[Successful cron evidence]
E --> F[Agent run result]
F --> G[Reminder warning decision]
G --> H[User reply]
Decision needed
Why: The code fixes the compaction-reset path, but the issue also requests behavior outside this diff; only maintainers can decide whether that broader behavior remains required. Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +4. Total +3 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the owner-boundary counter preservation as a scoped repair only if maintainers keep the prior isolated-session cron lookup question open, or explicitly decide that it is out of scope before the linked issue closes. Do we have a high-confidence way to reproduce the issue? Yes—source inspection gives a high-confidence path: create a successful cron add, deliver its pending event, then emit a retrying compaction event. Current main clears the count at that point; the PR regression directly observes the intended retained value. Is this the best way to solve the issue? Yes for the stated compaction defect: preserving the fact at the subscription owner is better than adding a downstream reminder-guard exception. It does not, however, settle the separate prior isolated-session cron lookup behavior in the linked issue. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 65bcdf2f261a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Closes #43292
What Problem This Solves
Fixes an issue where users who successfully scheduled an isolated-session reminder would receive a contradictory "I did not schedule a reminder" warning when context compaction retried the same agent turn.
Why This Change Was Made
A successful cron addition is a committed, turn-wide side effect. Compaction can reset transient presentation state, but must preserve the recorded successful-add fact that the reminder guard consumes. The existing session-specific persisted-job check and unrelated-job isolation remain unchanged.
Maintainer scope decision: both concrete reproductions in #43292 require a successful current-turn cron add followed by compaction, and this change repairs both at the shared state owner. The issue's separate suggestion to match any prior isolated cron by agent ID is intentionally declined: an unrelated cron for the same agent would then suppress a truthful warning for another session, and there is no established persisted origin-session provenance contract. This preserves the issue review's existing recommendation to keep persisted-job matching session-specific while fixing and closing the actual reported same-turn bug.
User Impact
Successfully scheduled reminders no longer produce false unscheduled-reminder warnings after context compaction. Genuine unscheduled reminders and reminders belonging to unrelated sessions retain their existing safeguards.
Evidence
1.AssertionError: expected +0 to be 1; after the one-line deletion, it passes.node scripts/run-tsgo.mjs -b test/tsconfig/tsconfig.core.test.agents-root.json --builders 1.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.test.ts src/agents/embedded-agent-subscribe.ts.@panzoom/panzoom/@types/pakodependencies and a pre-existingui/src/pages/chat/route-loader.tstype error. Its optional dead-export scan was skipped with the documentedOPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1; this change adds no exports.openclaw/ci-gate, all production and test type-check stripes, lint, policy guards, and relevant test shards.