Skip to content

The agent that grows with you

refactor(gateway): run_turn_runner resolves adapters through the intake/delivery seams

teknium1417d0c0f6a48
diff --git a/gateway/run_turn_runner.py b/gateway/run_turn_runner.py
index 795db094679..1b09f5af18a 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``.