fix(notificationDedupeGuard): dedupe hardening — Guard 2 fires on rank contradiction; Guard 1 catches same-rank re-emit#1242
Open
itskai-dev wants to merge 8 commits into
Open
Conversation
…tch cloud (task-1774294960543-v778wwmio)
- Add POST /tracking/live-cta and POST /tracking/live-visit endpoints to docs - Remove stale /activation/ghost-signups and /activation/ghost-signup-nudge from docs Fixes route-docs contract check failure blocking PR #1153
…(task-1774294960543-v778wwmio)
…ting Fixes bug where ops tasks were incorrectly routed to QA reviewers during validating-queue auto-reassignment. Root cause: suggestReviewer() uses metadata.lane for agentEligibleForTask() filtering (neverRoute/neverRouteUnlessLane), but executionSweeper never passed metadata — so lane keyword was never extracted and lane-based exclusions didn't fire. One-line fix: add metadata: meta to the suggestReviewer() call.
…ard 1 catches same-rank re-emit
Guard 2 was dead code: the timestamp condition (currentTaskUpdatedAt >
eventUpdatedAt) was never satisfied at the call site in server.ts PATCH
handler, where both values are task.updatedAt — always equal.
Fix:
- Drop Guard 2's timestamp condition — fires purely on rank contradiction
(doneRank > doingRank → suppress). Guards are now independent.
- Extend Guard 1 to detect same-rank re-emits: same updatedAt AND same
status as last emission — catches done→done, validating→validating.
- Cursor now stores { updatedAt, status } to support same-rank detection.
- Update getDedupeState() and pruneDedupeState() to use new cursor shape.
This closes the 'task notification honesty' vector where done→done
re-affirmations could slip through and re-notify agents for tasks
already marked done.
Tests: 14 in notification-dedupe-guard.test.ts (including new same-rank
re-emit test). Full suite: 223 test files, 2484 tests passing.
…lush - Default routing: no-mention messages route to main agent instead of being dropped (resolveDefaultAgentId helper added) - Speaker attribution: use ctx.identity.name for outbound attribution instead of hardcoded 'openclaw_agent' - SSE: subscribe to agent_identity_changed and flush cached attribution state (lastUpdateByAgent, lastEscalationAt) when agent identity changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the task notification honesty bug where same-status re-emissions (
done→done) slipped through and re-notified agents for already-done tasks.Root Cause
Two issues in
notificationDedupeGuard.ts:Guard 2 was dead code — its timestamp condition (
currentTaskUpdatedAt > eventUpdatedAt) was never satisfiable at theserver.tsPATCH call site, where both values aretask.updatedAt(always equal).No same-rank re-emit detection —
done→doneat the sameupdatedAthad no guard because Guard 2 only fires on rank changes, not same-rank re-emissions.Fix
doneRank > doingRank → suppress)updatedAt === lastSeen.updatedAt AND eventStatus === lastSeen.status{ updatedAt, status }to support Guard 1b same-rank checkgetDedupeState()/pruneDedupeState()Tests
tests/notification-dedupe-guard.test.ts— all pass'suppresses same-status re-emit (done→done on already-done task)'Proof (staging)