[argus] patch #44: unattended-silence: no blank-final retry, wider narration backstop, no token logging#8
Merged
Conversation
… wider narration backstop, no token logging Three fixes from the 2026-07-18/19 hourly-Telegram-spam incident. 1. EmptyFinalRetryMiddleware (patch bytedance#37) retried blank finals on every turn. On an unattended (scheduled-playbook) turn a blank final -- or the '.' no-op sentinel the playbook prompts now ask for -- is the DESIRED outcome (the bytedance#31/bytedance#32/bytedance#34 silence branch suppresses the send), so the retry re-sampled the model into narrating ('No meetings in the window...') and turned compliant silence into hourly channel noise. The middleware now reads 'unattended' from request.runtime.context (the same signal the bytedance#30 memory write policy uses) and returns the blank without retrying. Attended turns keep retry-once byte-for-byte. 2. The bytedance#34 narrated-silence backstop capped announcements at 120 chars; the real narrations ran to ~250 chars (three-sentence monologues) and sailed through every hour for two days. Cap is now 280, 'calendar/schedule is clear' and 'nothing ... attention' count as announcement phrasing, and a contrast/alert-marker veto ('but', 'however', 'urgent', 'moved', 'cancelled', ...) takes over from the cap as the protection for genuine content behind an announcement-shaped opener. 3. httpx logs every request URL at INFO, so the Telegram bot token appeared in the journal in plaintext on every send. The gateway bootstrap pins httpx/httpcore to WARNING; apply_logging_level only adjusts the deerflow/app hierarchies, so the pin survives the lifespan log-level override. Tests: test_empty_final_retry.py (+TestIsUnattended, +TestUnattendedNeverRetries incl. attended-still-retries guard), test_unattended_silence.py (+6 verbatim incident narrations that must blank, +5 veto cases that must survive). 114 pass in the two files; 1598 pass across the channel/middleware/gateway suites (one unrelated flaky shutdown-timing test passes in isolation). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PDzGEHrugU91DPkeV3MPLY
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.
Three related fixes for unattended (scheduled-playbook) channel turns:
.no-op sentinel) is the desired outcome — the Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used: bytedance/deer-flow#31/Web 聊天界面报错,Cli 使用正常,有无推荐排错方法?目前没有找到相关的日志信息 bytedance/deer-flow#32/背景调查只使用Tavily搜索且无法通过.env控制 bytedance/deer-flow#34 silence branch suppresses the send — and the retry re-sampled the model into narrating the silence instead, delivering noise on every cron tick. Readsunattendedfromrequest.runtime.context, the same signal the Missing Error Handling for Podcast Generation Failures bytedance/deer-flow#30 memory write policy uses. Attended behavior unchanged.calendar/schedule is clear+nothing ... attentionadded as announcement phrasing, and a contrast/alert-marker veto (but/however/urgent/moved/cancelled/...) protects genuine content behind an announcement-shaped opener.httpx/httpcoreto WARNING in the gateway bootstrap.PATCHES.md + backend/CLAUDE.md updated in the same commit per the ledger rule.
Tests: 114 pass in the two touched files; 1598 pass across channel/middleware/gateway suites (one unrelated flaky shutdown-timing test passes in isolation).
🤖 Generated with Claude Code