-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[runtime] subagent-announce should fingerprint-match parent's last assistant message and short-circuit duplicates #78369
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Summary
Even with the SILENT guard in place (issue #N — Branch 2 parity), duplicate user messages still happen because the announce flow trusts the LLM to self-detect prior delivery. A structural short-circuit is the proper fix: the runtime should detect already-delivered results from observable transcript state and skip the announce entirely.
Problem
The
subagent-announceflow currently fires the completion-delivery prompt regardless of what the parent agent has already said in its session. The only suppression mechanism is the SILENT_REPLY_TOKEN, which depends on the LLM noticing it just answered the same question. This is unreliable across:Proposed fix — runtime-side dedup
In
subagent-announce-4mg0K78I.js, insiderunSubagentAnnounceFlow, beforebuildAnnounceSteerMessage:fingerprintMatchesdesignConservative match. Both strings normalised to lowercase + collapsed whitespace. Match if any of:
findingsappears inassistant.text, ORassistant.textappears infindings, ORThe 60-char window threshold is empirical — long enough to avoid trivial coincidence (URLs, common phrases), short enough to catch paraphrase. False positives (skip when not actually duplicate) are far worse than false negatives (announce when parent already covered it), so err toward announcing.
Why it's safe
Why the SILENT-token-only fix is not enough
We applied per-AGENTS.md "Duplicate Detection Discipline" prose plus the Branch 2 SILENT guard upstream. Both help. Neither eliminates the failure mode because:
The runtime can do this reliably. The LLM cannot.
Effort
~30 lines core + ~50 lines tests. New helper
fingerprintMatchesshould live near the existing announce utilities;getMostRecentAssistantMessagelikely already exists or is one wrapper away from existing transcript-read helpers.Acceptance test
X.Xverbatim.Context
Companion to the SILENT-guard parity issue. Both should land; this one is the actual structural fix.