fix(email): disable intermediate progress delivery

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-11 16:50:47 +08:00
1 parent 4e865b91ee
commit 90b889394f
2 files changed
+22

No files matched your search

@@ -8,7 +8,10 @@ import pytest
from nanobot.bus.events import OutboundMessage
from nanobot.bus.outbound_events import ProgressEvent
from nanobot.bus.queue import MessageBus
from nanobot.channels.base import BaseChannel
from nanobot.channels.email.runtime import EmailChannel, EmailConfig
from nanobot.channels.manager import ChannelManager
from nanobot.config.schema import Config
def _make_config(**overrides) -> EmailConfig:
@@ -50,6 +53,19 @@ def _make_raw_email(
return msg.as_bytes()
def test_email_only_enables_final_reply_delivery() -> None:
manager = ChannelManager.__new__(ChannelManager)
manager.config = Config.model_validate({"channels": {"email": {"enabled": True}}})
manager.bus = MessageBus()
channel = manager._build_channel("email", EmailChannel, {"enabled": True})
assert channel.send_progress is False
assert channel.send_tool_hints is False
assert channel.supports_streaming is False
assert type(channel).send_reasoning_delta is BaseChannel.send_reasoning_delta
def test_fetch_new_messages_parses_unseen_and_marks_seen(monkeypatch) -> None:
raw = _make_raw_email(subject="Invoice", body="Please pay")