Skip to content

The agent that grows with you

refactor(approval): make is_local_interactive_session public

unsupportedpastelsb90903499406
diff --git a/tools/approval.py b/tools/approval.py
index 23d6467c7aa..363b4cc9d0b 100644
--- a/tools/approval.py
+++ b/tools/approval.py
@@ -1208,7 +1208,7 @@ def _is_local_viewer_turn() -> bool:
session key. The notifier is registered for every session turn, so it only tells side tasks (their own task
key, none registered) apart; it does not show anyone is attached."""
from agent.delegation_context import is_delegated_child_process_context
- return (approval_context._is_local_interactive_session() and approval_context.is_viewer_turn_with_approver()
+ return (approval_context.is_local_interactive_session() and approval_context.is_viewer_turn_with_approver()
and not is_delegated_child_process_context()
and _gateway_notify_cb(get_current_session_key()) is not None)
diff --git a/tools/approval_context.py b/tools/approval_context.py
index 90e48de728b..0eece969e1f 100644
--- a/tools/approval_context.py
+++ b/tools/approval_context.py
@@ -84,7 +84,7 @@ def gateway_approval_surface() -> str:
_LOCAL_INTERACTIVE_SOURCES = frozenset({"cli", "tui", "gui", "acp"})
-def _is_local_interactive_session() -> bool:
+def is_local_interactive_session() -> bool:
"""True for a classic CLI, TUI, Desktop or ACP session's turn, read from the launch policy the gateway
froze at ``session.create`` (never a per-turn client flag). Kanban, cron and forwarded routes keep
their own sources and stay out."""