Skip to content

[argus] patch #44: unattended-silence: no blank-final retry, wider narration backstop, no token logging#8

Merged
Nichol4s merged 1 commit into
argusfrom
argus-patch-44-unattended-silence
Jul 20, 2026
Merged

[argus] patch #44: unattended-silence: no blank-final retry, wider narration backstop, no token logging#8
Nichol4s merged 1 commit into
argusfrom
argus-patch-44-unattended-silence

Conversation

@Nichol4s

Copy link
Copy Markdown

Three related fixes for unattended (scheduled-playbook) channel turns:

  1. EmptyFinalRetryMiddleware skips unattended turns. Patch Ollama seems not supported bytedance/deer-flow#37 retried blank finals on every turn; on a scheduled turn a blank final (or the . 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. Reads unattended from request.runtime.context, the same signal the Missing Error Handling for Podcast Generation Failures bytedance/deer-flow#30 memory write policy uses. Attended behavior unchanged.
  2. Wider narrated-silence backstop. Cap 120 -> 280 (observed narrations run ~250 chars), calendar/schedule is clear + nothing ... attention added as announcement phrasing, and a contrast/alert-marker veto (but/however/urgent/moved/cancelled/...) protects genuine content behind an announcement-shaped opener.
  3. Stop logging the bot token. httpx logs every request URL at INFO, which puts the Telegram bot token in the journal on every send; pin httpx/httpcore to 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

… 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
@Nichol4s
Nichol4s merged commit 4084cee into argus Jul 20, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant