Skip to content

fix(gateway): silence idle stream duplicate warning - #110593

Closed
KoNit-K wants to merge 0 commit into
NousResearch:mainfrom
KoNit-K:fix/gateway-suppress-idle-stream-warning
Closed

KoNit-K wants to merge 0 commit into
NousResearch:mainfrom
KoNit-K:fix/gateway-suppress-idle-stream-warning

Conversation

@KoNit-K

@KoNit-K KoNit-K commented Sep 14, 2026 •

Copy link
Copy Markdown

What does this PR do?

This PR stops the gateway from emitting a possible duplicate send warning merely because a stream consumer object exists. It keeps the diagnostic when the turn has actual streaming-delivery evidence that was not reconciled with the normal final send.

Related Issue

Fixes #110590

Type of Change

  • ✅ Bug fix (non-breaking change that fixes an issue)

Changes Made

  • gateway/run_turn.py — require delivery evidence before logging the duplicate-send diagnostic.
  • tests/gateway/test_stream_delivery_warning.py — cover the all-false Telegram-like consumer and retain coverage for an unconfirmed preview mismatch.

How to Test

  • scripts/run_tests.sh tests/gateway/test_stream_delivery_warning.py — 2 passed after the fix; the idle-consumer assertion failed on origin/main while the control warning assertion passed.
  • scripts/run_tests.sh tests/gateway/test_stream_delivery_warning.py tests/gateway/test_duplicate_reply_suppression.py — 11 passed, including existing final-delivery suppression coverage.
  • Verify an idle consumer with streamed=False, previewed=False, and content_delivered=False produces no possible duplicate send warning.
  • Verify an unconfirmed preview remains observable through the existing warning, preserving the mismatch diagnostic.
  • scripts/run_tests.sh tests/gateway/test_stream_delivery_warning.py
  • scripts/run_tests.sh tests/gateway/test_stream_delivery_warning.py tests/gateway/test_duplicate_reply_suppression.py

Evidence

  • BEFORE: the focused probe was RED on origin/main before this change
  • AFTER: - [x] scripts/run_tests.sh tests/gateway/test_stream_delivery_warning.py — 2 passed after the fix; the idle-consumer assertion failed on origin/main while the control warning assertion passed. — 2 passed
  • CONTROL: neighboring paths listed in How to Test still pass

Checklist

Code

  • ✅ I've read the Contributing Guide
  • ✅ My commit messages follow Conventional Commits
  • ✅ I searched for existing PRs to make sure this isn't a duplicate
  • ✅ My PR contains only changes related to this fix
  • ✅ I've run relevant tests locally (see How to Test)
  • ✅ I've added tests for my changes
  • ✅ I've tested on my platform: macOS

Documentation & Housekeeping

  • ✅ Documentation update: N/A unless noted in Changes Made
  • ✅ cli-config.yaml.example: N/A
  • ✅ CONTRIBUTING.md or AGENTS.md: N/A
  • ✅ Cross-platform impact considered
  • ✅ Tool descriptions/schemas: N/A

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery area/streaming Streaming responses: gateway delivery, provider wire sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages duplicate This issue or pull request already exists labels Sep 14, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Duplicate of #103160 — that open, earlier PR changes the same elif _sc is not None branch in gateway/run_turn.py to the same streamed or previewed or content_delivered gate (and downgrades the no-signal case to info). #105446 addresses the same false positive via an interim-only consumer flag. Consider consolidating on one of the existing PRs.

@kvnloo

kvnloo commented Sep 15, 2026

Copy link
Copy Markdown

CHECK: subsumed by KEEP #111296 for #110590 / #111281.

Exact-head cross-link: this PR silences the idle-consumer duplicate-send WARNING when no delivery evidence exists. KEEP #111296 head dc714eac2136eac2d7eebdfe9535b348528bbaa4 is the narrower preview-only gate that matches the #111281 RCA (only _previewed without a confirming send is real duplicate risk). Prefer close-or-rebase after #111296 rather than merging both into gateway/run_turn.py.

effort: factory-easy
Abort if HEAD != 0111a3c

@KoNit-K KoNit-K closed this Sep 16, 2026
@KoNit-K
KoNit-K force-pushed the fix/gateway-suppress-idle-stream-warning branch from 0111a3c to 4768534 Compare September 16, 2026 18:15
@teknium1
teknium1 deployed to trusted-automation September 16, 2026 18:18 — with GitHub Actions Active

This branch was successfully deployed

2 active and 1 inactive deployments
trusted-automation — 47685348 Deployed Sep 16, 2026 by teknium1 via trigger-deploy #341
gh-image — 47685348 Deployed Sep 16, 2026 by fparrav via Publish inline E2E evidence #50548
container-publish — 47685348 Deployed Sep 16, 2026 by teknium1 via merge #55981
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/streaming Streaming responses: gateway delivery, provider wire comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway: 'possible duplicate send' warns on every Telegram turn when the stream consumer delivered nothing