From 417d0c0f6a4876e254ea4c3621add1eaf8ce6805 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 19 Sep 2026 00:09:02 -0700 Subject: [PATCH] refactor(gateway): run_turn_runner resolves adapters through the intake/delivery seams Mechanical migration of the `_adapter_for_source` call sites in this sibling. Intake policy sites take `_intake_adapter_for`; every send/edit/typing/pending-slot site takes `_delivery_adapter_for`. Part of #88715 (phase 4). --- gateway/run_turn_runner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gateway/run_turn_runner.py b/gateway/run_turn_runner.py index 795db09467..1b09f5af18 100644 --- a/gateway/run_turn_runner.py +++ b/gateway/run_turn_runner.py @@ -264,7 +264,7 @@ class TurnRunner: from agent.display import get_tool_emoji emoji = get_tool_emoji(tool_name, default="⚙️") try: - adapter = self._runner._adapter_for_source(ctx.source) + adapter = self._runner._delivery_adapter_for(ctx.source) except Exception: adapter = None code_full, code_short = self._progress_terminal_blocks(adapter, tool_name, args, emoji) @@ -704,7 +704,7 @@ class TurnRunner: async def send_progress_messages(self): ctx = self._ctx - adapter = self._runner._adapter_for_source(ctx.source) if ctx.progress_queue else None + adapter = self._runner._delivery_adapter_for(ctx.source) if ctx.progress_queue else None if not adapter: return if ctx._native_slack_task_cards and hasattr(adapter, "send_native_task_card_progress"): @@ -928,7 +928,7 @@ class TurnRunner: if want_stream_deltas or want_interim_messages: try: from gateway.stream_consumer import GatewayStreamConsumer - adapter = self._runner._adapter_for_source(ctx.source) + adapter = self._runner._delivery_adapter_for(ctx.source) if adapter: consumer_cfg, pause_typing_before_finalize = self._runner._build_stream_consumer_config( ctx.source, scfg, adapter, on_missing_cursor="raise", @@ -1597,7 +1597,7 @@ class TurnRunner: def _resume_note_interactive(self) -> bool: """Interactive platforms report the restore and ask what next; event platforms (webhook, API server) continue the work — nobody is present to answer.""" - return bool(getattr(self._runner._adapter_for_source(self._ctx.source), "interactive_resume", True)) + return bool(getattr(self._runner._delivery_adapter_for(self._ctx.source), "interactive_resume", True)) def _prepare_turn_message(self, agent_history): """Prepend recovery/notice guidance to ``ctx.message``.