fix(channel): quiet WeChat poll log noise with state-transition logging and exponential backoff#683
Merged
Merged
Conversation
added 2 commits
July 24, 2026 19:21
piorpua
pushed a commit
that referenced
this pull request
Jul 24, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.52](v0.1.51...v0.1.52) (2026-07-24) ### Features * **project:** wire project-bind side branch into owner creation ([#676](#676)) ([300c833](300c833)) ### Bug Fixes * **agent:** unify CLI probe pipeline with classified failures and adaptive slow-probe recheck ([#678](#678)) ([67945d2](67945d2)) * **channel:** quiet WeChat poll log noise with state-transition logging and exponential backoff ([#683](#683)) ([ea4da55](ea4da55)) * **process:** allow whitespace in workspace cwd segments ([#410](#410) parity) ([#674](#674)) ([c344b02](c344b02)) * **session:** restore codex slash commands + recover dead resume anchors on the direct-CLI path ([#679](#679)) ([7b60611](7b60611)) * **team:** converge system/lifecycle wakes into a team run ([#680](#680)) ([38facd7](38facd7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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
WeChat uses HTTP long-polling to receive messages. When the upstream (
ilink/bot/getupdates) is unavailable, the poll loop logged awarnon every attempt and retried on a tight2s × 3 + 30scadence forever. In production (level=info) this produced ~5 warn lines/minute per bound account, indefinitely — pure noise that also buried any real signal.This PR makes the WeChat poll loop quiet and self-throttling, with no change to Telegram / DingTalk / Lark, no
PluginStatus/UI change, and no new dependencies.Problem
warn(production-visible), with no de-duplication or rate limiting.2s × 3then30s, reset, repeat) was both noisy and wasteful, and never backed off further.Changes
Two orthogonal levers, both scoped to
crates/aionui-channel:warn("WeChat poll started failing")debugonly (invisible in production)info("WeChat poll recovered", with the failure count)2s × 3 + 30sscheme with2^nseconds capped at 10 minutes (2, 4, 8, 16, 32, 64, 128, 256, 512, 600, 600…). Retries are unbounded and self-healing — a single success resets the streak.Both API-error (
ret/errcode) and transport-error paths now share one failure counter, one backoff function, and one logging policy. The log-level decision (poll_log_action) and the backoff curve (backoff_delay) are extracted as pure functions for unit testing.The now-unused constants
WEIXIN_MAX_RETRIES,WEIXIN_RETRY_DELAY, andWEIXIN_BACKOFF_DELAYare removed;WEIXIN_MAX_BACKOFF(600s) is added.Behavior (upstream down for 1 hour, single account)
info)warnwarn+ recoverinfo)Testing
backoff_delay(exponential curve + 10-minute cap + overflow guard) andpoll_log_action(all four transitions).cargo test -p aionui-channel --features weixin→ 256 passed / 0 failed.cargo clippy -p aionui-channel --features weixin -- -D warningsand default-feature clippy both clean.just push) passed.warnon start, followed bydebuglines whose intervals matched the backoff curve (2 → 4 → 8 → 16 → 32 → 64 → 128 s); the old per-2swarnspam is gone.Non-goals
PluginStatus/UI change; the loop's fix is fully internal.Logging compliance
New
warn/infolines carry only the network/HTTP error string, numeric error codes, failure counts, and backoff seconds — no prompts, message bodies, tokens, or secrets.