move ui background message suppression into agent context

This commit is contained in:
jxxghp
2026-04-29 23:22:37 +08:00
parent 7ab643d34a
commit ef5bd29759
5 changed files with 47 additions and 42 deletions

View File

@@ -22,8 +22,8 @@ _stub_module("qbittorrentapi", TorrentFilesList=list)
_stub_module("transmission_rpc", File=object)
from app.chain.search import SearchChain
from app.agent_context import agent_execution_context
from app.core.config import settings
from app.core.message_context import suppress_message_channel
from app.schemas import Notification
from app.schemas.types import NotificationType
@@ -187,7 +187,7 @@ class SearchChainAIRecommendTest(unittest.IsolatedAsyncioTestCase):
"render",
return_value=notification,
),
suppress_message_channel(),
agent_execution_context(suppress_message_channel_dispatch=True),
):
chain.post_message(message=notification)