You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add an opt-in platforms.weixin.extra.final_response_priority transport gate
mark tool progress, interim commentary (including GatewayStreamConsumer), background-review notifications, and Weixin fallback heartbeats as transient_progress
preserve final replies and the existing lifecycle/status/approval/clarify/error metadata paths
distinguish an intentionally suppressed progress send from a message that actually reached the platform, so delivery reconciliation can never suppress an identical final reply
document the option in the English and Simplified Chinese Weixin guides
Why
Weixin/iLink cannot edit ordinary chat bubbles and has a tight send budget. In a shared Desktop/Weixin session, routine progress can consume that budget before the canonical final reply is ready. The adapter needs an explicit, opt-in boundary that drops only messages the gateway has classified as transient, before connection checks or any iLink call.
This complements #89180, which suppresses periodic cross-process lease-wait refreshes on non-editing chat adapters. It does not duplicate or modify that lease-refresh logic.
Delivery semantics
The option defaults to false; existing Weixin behavior is unchanged.
Suppression requires metadata to be a dictionary and metadata["transient_progress"] is True. Values such as False, 1, or "true" are not suppressed.
A suppressed send returns success=True to acknowledge an intentional no-op and prevent generic progress retries, plus raw_response.suppressed=true to state that no platform message was created.
GatewayStreamConsumer excludes suppressed commentary from its delivered-text ledger. If commentary text is later reused as the final reply, the final still reaches iLink.
Existing positional GatewayStreamConsumer construction remains compatible; the new optional metadata argument is appended after all existing parameters.
AI code review — automated review for reference; please use your judgment.
Well-engineered quota-preservation feature: the gateway stamps only genuinely non-final sends via one shared helper, the Weixin adapter's suppression is strictly gated on is True (junk-value matrix tested), the stream consumer gains a separate commentary_metadata lane so finals keep clean metadata, and — the subtle part most implementations miss — a suppressed commentary send never enters _delivered_commentary_texts, so it can't accidentally suppress the final reply whose text matches (that exact scenario has its own test). Docs in both locales spell out what stays deliverable. Items:
gateway/platforms/weixin.py:1922 — nit — suppressing long-running heartbeats means hours of silence on an opted-in adapter; consider having the suppression path bump a counter surfaced in status output (progress_suppressed: N) so "is it still alive?" remains answerable without re-enabling progress.
gateway/run.py:5347 — nit — _interim_assistant_cb now wraps every interim send in _transient_progress_metadata(...); the helper allocates a fresh dict per call — fine at this frequency, just noting it's on the streaming hot path.
No blocking issues found.
— reviewer-b (automated review)
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
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
platforms.weixin.extra.final_response_prioritytransport gateGatewayStreamConsumer), background-review notifications, and Weixin fallback heartbeats astransient_progressWhy
Weixin/iLink cannot edit ordinary chat bubbles and has a tight send budget. In a shared Desktop/Weixin session, routine progress can consume that budget before the canonical final reply is ready. The adapter needs an explicit, opt-in boundary that drops only messages the gateway has classified as transient, before connection checks or any iLink call.
This complements #89180, which suppresses periodic cross-process lease-wait refreshes on non-editing chat adapters. It does not duplicate or modify that lease-refresh logic.
Delivery semantics
false; existing Weixin behavior is unchanged.metadatato be a dictionary andmetadata["transient_progress"] is True. Values such asFalse,1, or"true"are not suppressed.success=Trueto acknowledge an intentional no-op and prevent generic progress retries, plusraw_response.suppressed=trueto state that no platform message was created.GatewayStreamConsumerexcludes suppressed commentary from its delivered-text ledger. If commentary text is later reused as the final reply, the final still reaches iLink.GatewayStreamConsumerconstruction remains compatible; the new optional metadata argument is appended after all existing parameters.Tests
Local Windows verification:
The two deselected cases are pre-existing Windows
Path.as_uri()backslash-encoding assertions unrelated to this change. Focused regressions cover:Related: #89166, #21126
Complements: #89180